Documentation ¶
Overview ¶
Package gcsstore implements the blob.StoreCloser interface using a GCS bucket.
Index ¶
- func New(ctx context.Context, bucketName string, opts Options) (blob.StoreCloser, error)
- func Opener(ctx context.Context, addr string) (blob.StoreCloser, error)
- type KV
- func (s KV) Delete(ctx context.Context, key string) error
- func (s KV) Get(ctx context.Context, key string) ([]byte, error)
- func (s KV) Len(ctx context.Context) (int64, error)
- func (s KV) List(ctx context.Context, start string, f func(string) error) error
- func (s KV) Put(ctx context.Context, opts blob.PutOptions) error
- type Options
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
A KV implements the blob.KV interface using a GCS bucket.
type Options ¶
type Options struct { // The prefix to prepend to each key written by the store. // If unset, no prefix is prepended and keys are written at the top level. // See also ShardPrefixLen. Prefix string // The length of the key shard prefix. If positive, the key is partitioned // into a prefix of this length and a suffix comprising the rest of the key, // separated by a "/". For example, if ShardPrefixLen is 3, then the key // 01234567 will be split to 012/01234567. ShardPrefixLen int // If set, the bucket will be created in this project if it does not exist. Project string // If set, options to pass when creating a bucket. BucketAttrs *storage.BucketAttrs // If not nil, return JSON credentials. Credentials func(context.Context) ([]byte, error) // If true and credentials are not provided, connect without authentication. // If false, default application credentials will be used from the environment. Unauthenticated bool }
Options control the construction of a KV.
Click to show internal directories.
Click to hide internal directories.