Documentation ¶
Index ¶
- Variables
- func ValidateSecret(secret map[string][]byte, name string) error
- type GCPClient
- func (c *GCPClient) BucketExists(ctx context.Context, bucketName string) (bool, error)
- func (c *GCPClient) Close(log logr.Logger)
- func (c *GCPClient) FGetObject(ctx context.Context, bucketName, objectName, localPath string) error
- func (c *GCPClient) ListObjects(ctx context.Context, bucketName string, query *gcpstorage.Query) *gcpstorage.ObjectIterator
- func (c *GCPClient) ObjectExists(ctx context.Context, bucketName, objectName string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IteratorDone is returned when the looping of objects/content // has reached the end of the iteration. IteratorDone = iterator.Done // ErrorDirectoryExists is an error returned when the filename provided // is a directory. ErrorDirectoryExists = errors.New("filename is a directory") // ErrorObjectDoesNotExist is an error returned when the object whose name // is provided does not exist. ErrorObjectDoesNotExist = errors.New("object does not exist") )
Functions ¶
Types ¶
type GCPClient ¶
type GCPClient struct { // client for interacting with the Google Cloud // Storage APIs. *gcpstorage.Client }
func NewClient ¶
NewClient creates a new GCP storage client. The Client will automatically look for the Google Application Credential environment variable or look for the Google Application Credential file.
func (*GCPClient) BucketExists ¶
BucketExists checks if the bucket with the provided name exists.
func (*GCPClient) FGetObject ¶
FGetObject gets the object from the bucket and downloads the object locally
func (*GCPClient) ListObjects ¶
func (c *GCPClient) ListObjects(ctx context.Context, bucketName string, query *gcpstorage.Query) *gcpstorage.ObjectIterator
ListObjects lists the objects/contents of the bucket whose bucket name is provided. the objects are returned as an Objectiterator and .Next() has to be called on them to loop through the Objects.
Click to show internal directories.
Click to hide internal directories.