storage

package
v0.0.0-...-d6b3ed6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLEntity

type ACLEntity = storage.ACLEntity

type ACLHandle

type ACLHandle interface {
	Delete(context.Context, ACLEntity) error
	Set(context.Context, ACLEntity, ACLRole) error
	List(context.Context) ([]ACLRule, error)
}

type ACLRole

type ACLRole = storage.ACLRole

type ACLRule

type ACLRule = storage.ACLRule

type BucketAttrs

type BucketAttrs = storage.BucketAttrs

type BucketAttrsToUpdate

type BucketAttrsToUpdate = storage.BucketAttrsToUpdate

type BucketHandle

type BucketHandle interface {
	Create(context.Context, string, *BucketAttrs) error
	Delete(context.Context) error
	DefaultObjectACL() ACLHandle
	Object(string) ObjectHandle
	Attrs(context.Context) (*BucketAttrs, error)
	Update(context.Context, BucketAttrsToUpdate) (*BucketAttrs, error)
	If(storage.BucketConditions) BucketHandle
	Objects(context.Context, *Query) ObjectIterator
	ACL() ACLHandle
	IAM() *iam.Handle
	UserProject(projectID string) BucketHandle
	Notifications(context.Context) (map[string]*Notification, error)
	AddNotification(context.Context, *Notification) (*Notification, error)
	DeleteNotification(context.Context, string) error
	LockRetentionPolicy(context.Context) error
}

type BucketIterator

type BucketIterator interface {
	SetPrefix(string)
	Next() (*storage.BucketAttrs, error)
	PageInfo() *iterator.PageInfo
}

type Client

type Client interface {
	Bucket(name string) BucketHandle
	Buckets(ctx context.Context, projectID string) BucketIterator
	Close() error
}

func NewClient

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

NewClient creates a new Google Cloud Storage client. The default scope is ScopeFullControl. To use a different scope, like ScopeReadOnly, use option.WithScopes.

Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines.

You may configure the client by passing in options from the google.golang.org/api/option package. You may also use options defined in this package, such as [WithJSONReads].

type Composer

type Composer interface {
	ObjectAttrs() *ObjectAttrs
	Run(context.Context) (*ObjectAttrs, error)
}

type Conditions

type Conditions = storage.Conditions

type Copier

type Copier interface {
	ObjectAttrs() *ObjectAttrs
	SetRewriteToken(string)
	SetProgressFunc(func(uint64, uint64))
	SetDestinationKMSKeyName(string)
	Run(context.Context) (*ObjectAttrs, error)
}

type Notification

type Notification = storage.Notification

type ObjectAttrs

type ObjectAttrs = storage.ObjectAttrs

type ObjectAttrsToUpdate

type ObjectAttrsToUpdate = storage.ObjectAttrsToUpdate

type ObjectHandle

type ObjectHandle interface {
	ACL() ACLHandle
	Generation(int64) ObjectHandle
	If(Conditions) ObjectHandle
	Key([]byte) ObjectHandle
	ReadCompressed(bool) ObjectHandle
	Attrs(context.Context) (*ObjectAttrs, error)
	Update(context.Context, ObjectAttrsToUpdate) (*ObjectAttrs, error)
	NewReader(context.Context) (Reader, error)
	NewRangeReader(context.Context, int64, int64) (Reader, error)
	NewWriter(context.Context) Writer
	Delete(context.Context) error
	CopierFrom(ObjectHandle) Copier
	ComposerFrom(...ObjectHandle) Composer
}

type ObjectIterator

type ObjectIterator interface {
	Next() (*storage.ObjectAttrs, error)
	PageInfo() *iterator.PageInfo
}

type Query

type Query = storage.Query

type Reader

type Reader interface {
	io.ReadCloser
	Size() int64
	Remain() int64
	ContentType() string
	ContentEncoding() string
	CacheControl() string
}

type Writer

type Writer interface {
	io.WriteCloser
	ObjectAttrs() *ObjectAttrs
	SetChunkSize(int)
	SetProgressFunc(func(int64))
	SetCRC32C(uint32)
	CloseWithError(err error) error
	Attrs() *storage.ObjectAttrs
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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