Documentation ¶
Overview ¶
Package gcsutil contains utility functions for Google Cloud Storage data access.
Index ¶
- type Client
- func (c *Client) GetBlobData(bucketName string, blobPath string) ([]byte, error)
- func (c *Client) GetLogsData(bucketName string, relativePath string) ([][]byte, error)
- func (c *Client) ListBlobPaths(bucketName string, relativePath string) ([]string, error)
- func (c *Client) ListLogFilePaths(bucketName string, relativePath string) ([]string, error)
- type ContextInStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The documentation for context states:
Contexts should not be stored inside a struct type, but instead passed to each function that needs it.
However, while it is generally important to pass the Context rather than store it in another type, in the case below, this is not needed since there is no risk of confusion. Indeed, the context is only used for the GCS client here. Note that, if the use of context is extended in the future, then it should be passed explicitly to each function that needs it as an argument.
Client contains a Google Cloud Storage client and a context.Context.
func NewClientWithContext ¶
NewClientWithContext creates and returns a new Client. The given ctx is used for the lifetime of the Client!
func (*Client) GetBlobData ¶
GetBlobData gets the data in a blob in a Google Cloud Storage bucket.
func (*Client) GetLogsData ¶
GetLogsData gets the data in log-files in a Google Cloud Storage bucket under a relative path.
func (*Client) ListBlobPaths ¶
ListBlobPaths returns all the objects paths in a Google Cloud Storage bucket under a given relative path.
type ContextInStruct ¶
ContextInStruct contains contexts that can be used in structures when there is no risk of confusion. Using context.Context directly can lead to linting errors.