Skip to content

Commit

Permalink
Add build status and update example code to pass tip go vet
Browse files Browse the repository at this point in the history
  • Loading branch information
kothar committed Dec 1, 2015
1 parent 4a9d731 commit 55c8a34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
@@ -1,5 +1,6 @@
# go-backblaze
[![GoDoc](https://godoc.org/gopkg.in/kothar/go-backblaze.v0?status.svg)](https://godoc.org/gopkg.in/kothar/go-backblaze.v0)
[![Build Status](https://travis-ci.org/kothar/go-backblaze.svg)](https://travis-ci.org/kothar/go-backblaze)

A golang client for Backblaze's B2 storage

Expand Down
27 changes: 15 additions & 12 deletions examples_test.go
Expand Up @@ -5,25 +5,28 @@ import (
"path/filepath"
)

func ExampleB2(accountID, applicationKey string) *B2 {
b2, _ := NewB2(Credentials{
AccountID: accountID,
ApplicationKey: applicationKey,
func ExampleB2() {
NewB2(Credentials{
AccountID: "", // Obtained from your B2 account page.
ApplicationKey: "", // Obtained from your B2 account page.
})
return b2
}

func ExampleBucket(b2 *B2) *Bucket {
bucket, _ := b2.CreateBucket("test_bucket", AllPrivate)
return bucket
func ExampleBucket() {
var b2 B2
// ...

b2.CreateBucket("test_bucket", AllPrivate)
}

func ExampleBucketUploadFile(bucket *Bucket, path string) *File {
func ExampleBucket_UploadFile() {
var bucket Bucket
// ...

path := "/path/to/file"
reader, _ := os.Open(path)
name := filepath.Base(path)
metadata := make(map[string]string)

file, _ := bucket.UploadFile(name, metadata, reader)

return file
bucket.UploadFile(name, metadata, reader)
}

0 comments on commit 55c8a34

Please sign in to comment.