utils

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils provides utility functions

Index

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 NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*storage.Client, error)

NewClient creates a new GCS client with robust settings.

func ParseGCSPath

func ParseGCSPath(path string) (string, string, int64, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL