aboutsummaryrefslogtreecommitdiffstats
path: root/examples/object_storage/main.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-14 18:21:10 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-14 18:21:10 +0200
commitf6fe29c80d11662a169806dcf413ecdedcb28fa3 (patch)
tree9958034c27521f720f8c5d83c12120ada196f48a /examples/object_storage/main.go
parent91bf16b2336e6f80f0742be729582fe5fbbada83 (diff)
downloadgo-git-f6fe29c80d11662a169806dcf413ecdedcb28fa3.tar.gz
core: Storage, removing err returning *Storages
Diffstat (limited to 'examples/object_storage/main.go')
-rw-r--r--examples/object_storage/main.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/examples/object_storage/main.go b/examples/object_storage/main.go
index 5cba6e6..22fa426 100644
--- a/examples/object_storage/main.go
+++ b/examples/object_storage/main.go
@@ -8,26 +8,25 @@ import (
"github.com/aerospike/aerospike-client-go"
- "gopkg.in/src-d/go-git.v3"
+ "gopkg.in/src-d/go-git.v4"
)
func main() {
url := os.Args[2]
- r, err := git.NewRepository(url, nil)
+ client, err := aerospike.NewClient("127.0.0.1", 3000)
if err != nil {
panic(err)
}
- client, err := aerospike.NewClient("127.0.0.1", 3000)
+ s := NewAerospikeStorage(url, client)
+ r, err := git.NewRepository(s)
if err != nil {
panic(err)
}
- r.Storage = NewAerospikeObjectStorage(url, client)
-
switch os.Args[1] {
- case "pull":
- pull(r)
+ case "clone":
+ clone(r, url)
case "list":
list(r)
default:
@@ -35,11 +34,11 @@ func main() {
}
}
-func pull(r *git.Repository) {
- fmt.Printf("Retrieving %q ...\n", os.Args[2])
+func clone(r *git.Repository, url string) {
+ fmt.Printf("Cloning %q ...\n", os.Args[2])
start := time.Now()
- if err := r.PullDefault(); err != nil {
+ if err := r.Clone(&git.CloneOptions{URL: url}); err != nil {
panic(err)
}