Skip to content

Instantly share code, notes, and snippets.

@nrb
Created May 21, 2018 21:20
Show Gist options
  • Select an option

  • Save nrb/4dff94d1579cb9c06c5280500ca27a54 to your computer and use it in GitHub Desktop.

Select an option

Save nrb/4dff94d1579cb9c06c5280500ca27a54 to your computer and use it in GitHub Desktop.
type writeReadDeleter interface {
NewWriter(context.Context) io.WriteCloser
NewReader(context.Context) (io.ReadCloser, error)
Delete(context.Context) error
}
type objectIterator interface {
Next() (writeReadDeleter, error)
}
// interface objecter represents an object compatible with the GCP object object API
type objecter interface {
Object(string) writeReadDeleter
Objects(context.Context, *storage.Query) objectIterator
}
// Interface bucketer represents a client compatible with the GCP object storage API.
type bucketer interface {
// Bucket returns an object representing a GCP object storage bucket
Bucket(string) objecter
}
type objectStore struct {
client bucketer
googleAccessID string
privateKey []byte
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment