object

package
v1.0.81 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrSet

type AttrSet struct {
	// contains filtered or unexported fields
}

AttrSet used to set optional GCS object attributes in upload, write, and update operations

func (AttrSet) CacheControl

func (a AttrSet) CacheControl(cacheControl string) AttrSet

CacheControl sets the Cache-Control attribute of an object

func (AttrSet) GetCacheControl

func (a AttrSet) GetCacheControl() *string

GetCacheControl returns the configured Cache-Control object for this AttrSet. (nil if not set)

type AttrSetter

type AttrSetter func(AttrSet) AttrSet

AttrSetter used to set optional GCS object attributes in upload, write, and update operations

type Attrs

type Attrs interface {
	Attrs() *storage.ObjectAttrs
	SyncOperation
}

Attrs reads the attributes of an object in a GCS bucket

func NewAttrs

func NewAttrs() Attrs

type Delete

type Delete interface {
	SyncOperation
}

func NewDelete

func NewDelete() Delete

type Download

type Download interface {
	SyncOperation
}

func NewDownload

func NewDownload(toFile string) Download

type Exists

type Exists interface {
	Exists() bool
	SyncOperation
}

func NewExists

func NewExists() Exists

type Object

type Object struct {
	Ctx    context.Context
	Handle *storage.ObjectHandle
}

type Read

type Read interface {
	Content() []byte
	SyncOperation
}

Read reads the content of an object in a GCS bucket

func NewRead

func NewRead() Read

type SyncOperation added in v1.0.8

type SyncOperation interface {
	// Handler performs the call, given object and logger references
	Handler(object Object, logger zerolog.Logger) error
	// Kind returns the a description of the kind of this operation (eg. "delete", "upload")
	Kind() string
}

SyncOperation is an interface for synchronous operations on GCS bucket objects

type Update

type Update interface {
	SyncOperation
}

Update updates attributes of an object in a GCS bucket

func NewUpdate

func NewUpdate(attrs AttrSet) Update

type Upload

type Upload interface {
	SyncOperation
}

func NewUpload

func NewUpload(fromFile string, attrs AttrSet) Upload

type Write

type Write interface {
	SyncOperation
}

func NewWrite

func NewWrite(content []byte, attrs AttrSet) Write

func NewWriteFromStream added in v1.0.8

func NewWriteFromStream(reader io.Reader, attrs AttrSet) Write

Jump to

Keyboard shortcuts

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