Documentation
¶
Overview ¶
Package utils provides utility functions
Index ¶
- Variables
- func NewClient(ctx context.Context, opts ...option.ClientOption) (*storage.Client, error)
- func ParseGCSPath(path string) (string, string, int64, error)
- func RetryBucket(client *storage.Client, name string) *storage.BucketHandle
- func RetryObject(bucket *storage.BucketHandle, name string) *storage.ObjectHandle
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidArgs = errors.New("invalid arguments") ErrOnlyGCS = errors.New("only gs:// paths are supported") ErrGenerationRequired = errors.New("generation number is required") ErrURLRequired = errors.New("URL [URL ...]: Must be specified") ErrObjectRequired = errors.New("URL must include an object name") )
View Source
var (
ErrInvalidGCSPath = errors.New("invalid GCS path")
)
Functions ¶
func ParseGCSPath ¶
ParseGCSPath parses a GCS path of the form "gs://bucket/object[#generation]" and returns the bucket, object, and generation.
func RetryBucket ¶
func RetryBucket(client *storage.Client, name string) *storage.BucketHandle
RetryBucket returns a BucketHandle with RetryAlways policy.
func RetryObject ¶
func RetryObject(bucket *storage.BucketHandle, name string) *storage.ObjectHandle
RetryObject returns an ObjectHandle with RetryAlways policy.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.