storage

package
v0.0.0-...-63046b2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Key []byte = []byte(os.Getenv("KEY"))

Functions

func CreateClient

func CreateClient(ctx context.Context) (*storage.Client, error)

Types

type StorageOp

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

func NewStorageOp

func NewStorageOp(ctx context.Context, client storage.Client, bucketName string) *StorageOp

Create Google Cloud Storage operation handler.

func (*StorageOp) Delete

func (s *StorageOp) Delete(prefix string) error

Delete files

func (*StorageOp) DisableVersioning

func (s *StorageOp) DisableVersioning() error

disable to versioning.

func (*StorageOp) FileExist

func (s *StorageOp) FileExist(dirs []string, fileName string) (bool, error)

Check if file exists. Exist if true, false not.

func (*StorageOp) Object

func (s *StorageOp) Object(dirs []string, fileName string) *storage.ObjectHandle

Create Storage object. Returns an ObjectHandle that looks like a directory and file to manipulate.

func (*StorageOp) ReadFile

func (s *StorageOp) ReadFile(dirs []string, fileName string) ([]byte, error)

Read file.

func (*StorageOp) WriteFile

func (s *StorageOp) WriteFile(dirs []string, fileName string, body []byte) error

Write file

Jump to

Keyboard shortcuts

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