Documentation ¶
Overview ¶
Package gcs provides wrappers around Google Cloud Storage (GCS) APIs. Package uses Application Default Credentials assuming that the program runs on GCE.
See the following links for details and API reference: https://cloud.google.com/go/getting-started/using-cloud-storage https://godoc.org/cloud.google.com/go/storage
Index ¶
- Constants
- Variables
- type Client
- func (client *Client) Close()
- func (client *Client) DeleteFile(gcsFile string) error
- func (client *Client) FileExists(gcsFile string) (bool, error)
- func (client *Client) FileWriter(gcsFile string) (io.WriteCloser, error)
- func (client *Client) FileWriterExt(gcsFile, contentType, contentEncoding string) (io.WriteCloser, error)
- func (client *Client) GetDownloadURL(gcsFile string, publicURL bool) string
- func (client *Client) ListObjects(bucketObjectPath string) ([]*Object, error)
- func (client *Client) Publish(gcsFile string) error
- func (client *Client) Read(gcsFile string) (*File, error)
- func (client *Client) UploadFile(localFile, gcsFile, contentType, contentEncoding string) error
- type File
- type Object
Constants ¶
View Source
const ( PublicPrefix = "https://storage.googleapis.com/" AuthenticatedPrefix = "https://storage.cloud.google.com/" )
Where things get published.
Variables ¶
View Source
var ErrFileNotFound = errors.New("the requested files does not exist")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeleteFile ¶
func (*Client) FileWriter ¶
func (client *Client) FileWriter(gcsFile string) (io.WriteCloser, error)
func (*Client) FileWriterExt ¶
func (client *Client) FileWriterExt(gcsFile, contentType, contentEncoding string) (io.WriteCloser, error)
func (*Client) GetDownloadURL ¶
func (*Client) ListObjects ¶
ListObjects expects "bucket/path" or "bucket" as input.
func (*Client) UploadFile ¶
Click to show internal directories.
Click to hide internal directories.