Documentation ¶
Index ¶
- type BackendConfig
- type Client
- func (c *Client) BackendName() string
- func (c *Client) Bucket() string
- func (c *Client) BucketExists(ctx context.Context, name string) (bool, error)
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Disconnect(ctx context.Context) error
- func (c *Client) Name() string
- func (c *Client) ObjectExists(ctx context.Context, name string) (bool, error)
- func (c *Client) UploadFile(ctx context.Context, name string, file io.Reader, filesize int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendConfig ¶
type BackendConfig struct { BackendName string `yaml:"name"` CredentialsFile string `yaml:"credsfile"` Bucket string `yaml:"bucketname"` }
BackendConfig is the data structure containing all information required to connect to a Google Cloud Storage account
func (*BackendConfig) Name ¶
func (conf *BackendConfig) Name() string
Name returns the name configured for this Google Cloud Storage Backend
func (*BackendConfig) Validate ¶
func (conf *BackendConfig) Validate() error
Validate validates the Google Cloud Storage Backend and returns the first error that occured during validation.
type Client ¶
type Client struct { Conn *storage.Client Config BackendConfig }
Client is an Google Cloud Storage Client Object
func New ¶
func New(ctx context.Context, conf BackendConfig) *Client
New creates a new Google Cloud Storage client
func (*Client) BackendName ¶
BackendName returns 'Google Cloud Storage'
func (*Client) BucketExists ¶
BucketExists returns if a particular bucket exists and is reachable by the Google Cloud Storage client
func (*Client) Connect ¶
Connect connects the Google Cloud Storage client to the backend service and authenticates
func (*Client) Disconnect ¶
Disconnect terminates the connection of the Google Cloud Storage client with the backend server
func (*Client) ObjectExists ¶
ObjectExists returns if a particular object exists and is reachable by the Google Cloud Storage client