object

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 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
	Operation
}

Attrs reads the attributes of an object in a GCS bucket

func NewAttrs

func NewAttrs() Attrs

type Delete

type Delete interface {
	Operation
}

func NewDelete

func NewDelete() Delete

type Download

type Download interface {
	Operation
}

func NewDownload

func NewDownload(toFile string) Download

type Exists

type Exists interface {
	Exists() bool
	Operation
}

func NewExists

func NewExists() Exists

type Object

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

type Operation

type Operation 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
}

Operation is an interface for operations on GCS bucket objects

type Read

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

Read reads the content of an object in a GCS bucket

func NewRead

func NewRead() Read

type Update

type Update interface {
	Operation
}

Update updates attributes of an object in a GCS bucket

func NewUpdate

func NewUpdate(attrs AttrSet) Update

type Upload

type Upload interface {
	Operation
}

func NewUpload

func NewUpload(fromFile string, attrs AttrSet) Upload

type Write

type Write interface {
	Operation
}

func NewWrite

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

Jump to

Keyboard shortcuts

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