GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - s3git/s3git-go: SDK package in Golang for s3git: git for Cloud Storage

BranchesTags
Open more actions menu

Latest commit

 

History

230 Commits
230 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
internal
internal
 
 
.travis-disabled.yml
.travis-disabled.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
clone.go
clone.go
 
 
clone_test.go
clone_test.go
 
 
commit.go
commit.go
 
 
commit_test.go
commit_test.go
 
 
pull.go
pull.go
 
 
pull_test.go
pull_test.go
 
 
push.go
push.go
 
 
push_test.go
push_test.go
 
 
remote.go
remote.go
 
 
repository.go
repository.go
 
 
repository_test.go
repository_test.go
 
 
snapshot.go
snapshot.go
 
 
util.go
util.go
 
 

Repository files navigation

s3git-go

Join the chat at https://gitter.im/s3git/s3git

This is the go SDK package for s3git.

For brevity reasons, error handling and other boilerplate code like package naming etc. is not shown in the examples. Actual client code should always check for errors, see s3git as an example.

DISCLAIMER: This software is still under development (although the storage format/model using BLAKE2 hashing is stable) -- use at your own peril for now

Note that the API is not stable yet, you can expect minor changes

BLAKE2 Tree Hashing

If you would like to understand how s3git uses the BLAKE2 Tree hashing mode please see here.

Development environment

See here for setting up the development environment.

Create a repository

import "github.com/s3git/s3git-go"

// Create repo
repo, _ := s3git.InitRepository(".")

// Add some data
repo.Add(strings.NewReader("hello s3git"))

// Commit changes
repo.Commit("Initial commit")

// List commits
commits, _ := repo.ListCommits("")

for commit := range commits {
    fmt.Println(commit)
}

See here for the full example (and others). And run like this:

$ cd $GOPATH/src/github.com/s3git/s3git-go/examples
$ go run create.go

Clone a repository

import "github.com/s3git/s3git-go"

options := []s3git.CloneOptions{}
options = append(options, s3git.CloneOptionSetAccessKey("AKIAJYNT4FCBFWDQPERQ"))
options = append(options, s3git.CloneOptionSetSecretKey("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"))

// Clone a repo
repo, _ := s3git.Clone("s3://s3git-spoon-knife", ".", options...)

// List contents
list, _ := repo.List("")

for l := range list {
    fmt.Println(l)
}

Make changes and push

import "github.com/s3git/s3git-go"

repo, _ := s3git.OpenRepository(".")

repo.Add(strings.NewReader(fmt.Sprint(time.Now())))

repo.Commit("New commit")

hydrate := false 	// For explanation, see https://github.com/s3git/s3git/blob/master/BLAKE2.md#hydrated
repo.Push(hydrate)

See change_and_push.go.

Pull down changes

import "github.com/s3git/s3git-go"

repo, _ := s3git.OpenRepository(".")

repo.Pull()

repo.Log()

Extract data

import "github.com/s3git/s3git-go"

repo, _ := s3git.OpenRepository(".")

r, _ := repo.Get("012345678")

io.Copy(os.Stdout, r)

Clone a repository with progress

import "github.com/s3git/s3git-go"

repo, _ := s3git.Clone("s3://s3git-100m", ".")

Contributions

Contributions are welcome! Please see CONTRIBUTING.md.

License

s3git-go is released under the Apache License v2.0. You can find the complete text in the file LICENSE.

About

SDK package in Golang for s3git: git for Cloud Storage

s3git.org

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

48 stars

Watchers

5 watching

Forks

6 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.