Documentation ¶
Index ¶
- type API
- type APIWrapper
- func (caw *APIWrapper) CreateBucket(ctx context.Context, name string, location string) error
- func (caw *APIWrapper) DeleteBucket(ctx context.Context, name string) error
- func (caw *APIWrapper) Read(ctx context.Context, bucket, storageObject string) ([]byte, error)
- func (caw *APIWrapper) Write(ctx context.Context, data []byte, bucket, storageObject string) error
- type Bucket
- type Client
- func (sc *Client) CreateBucket(ctx context.Context, name string, location string) error
- func (sc *Client) DeleteBucket(ctx context.Context, name string) error
- func (sc *Client) Read(ctx context.Context, bucket, storageObject string) ([]byte, error)
- func (sc *Client) Write(ctx context.Context, data []byte, bucket, storageObject string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { CreateBucket(ctx context.Context, name string, location string) error DeleteBucket(ctx context.Context, name string) error Read(ctx context.Context, bucket, storageObject string) ([]byte, error) Write(ctx context.Context, data []byte, bucket, storageObject string) error }
API provides a mockable interface for the GCP api. Find the implementation of the GCP wrapped API in wrapped.go
type APIWrapper ¶
APIWrapper wraps the GCP api
func (*APIWrapper) CreateBucket ¶
CreateBucket attempts to create a storage bucket
func (*APIWrapper) DeleteBucket ¶
func (caw *APIWrapper) DeleteBucket(ctx context.Context, name string) error
DeleteBucket attempts to delete a storage bucket
type Client ¶
type Client struct { Option // contains filtered or unexported fields }
Client wrapper for GCS storage API
func (*Client) CreateBucket ¶
CreateBucket attempts to create a storage bucket
func (*Client) DeleteBucket ¶
DeleteBucket attempts to delete a storage bucket
type Option ¶
type Option struct { Prefix string // storage prefix ProjectID string // GCP project ID LocationID string // location of the key rings ServiceAccount string // filename of the serviceaccount to use }
Option wrapper for relevant Options for the client
func (Option) WithPrefix ¶
WithPrefix modifies option to have a prefix
func (Option) WithProjectID ¶
WithProjectID modifies option to have a project id
func (Option) WithServiceAccount ¶
WithServiceAccount modifies option to have a service account
Click to show internal directories.
Click to hide internal directories.