gsutil

package
v0.0.0-...-1c9e867 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomReader

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

CustomReader contains the details of Chunks being downloaded

func (*CustomReader) Read

func (r *CustomReader) Read(p []byte) (int, error)

Read with updates notification

func (*CustomReader) ReadAt

func (r *CustomReader) ReadAt(p []byte, off int64) (int, error)

ReadAt with updates notification

func (*CustomReader) Seek

func (r *CustomReader) Seek(offset int64, whence int) (int64, error)

Seek implementation

type CustomWriter

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

CustomWriter with notification on updates

func (*CustomWriter) Seek

func (r *CustomWriter) Seek(offset int64, whence int) (int64, error)

Seek implementation

func (*CustomWriter) Write

func (r *CustomWriter) Write(p []byte) (int, error)

Write with notification on updates

func (*CustomWriter) WriteAt

func (r *CustomWriter) WriteAt(p []byte, off int64) (int, error)

WriteAt with notification on updates

type GSctx

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

GSctx context for google cloud storage communication

func NewGsCtx

func NewGsCtx(ctx context.Context, projectID, apiKeyJSONContent string, hctx *http.Client, requestWriteAccess bool) (*GSctx, error)

NewGsCtx creates GSctx for provided options it uses data from apiKeyJSONContent to decode service account credentials setting of requestWriteAccess adds write scope to token in case of provided hctx

func (*GSctx) CreateBucket

func (s *GSctx) CreateBucket(bname string) error

CreateBucket creates bucket with the given name

func (*GSctx) DeleteBucket

func (s *GSctx) DeleteBucket(bname string) error

DeleteBucket removes the bucket

func (*GSctx) DeleteObject

func (s *GSctx) DeleteObject(bname, bkey string) error

DeleteObject removes the object from bucket

func (*GSctx) DownloadFile

func (s *GSctx) DownloadFile(fname, bname, bkey string,
	bsize int64, prgNotify types.StatsNotifChan) error

DownloadFile from Google Storage

func (*GSctx) GetObjectMD5

func (s *GSctx) GetObjectMD5(bname, bkey string) (string, error)

GetObjectMD5 returns hex string of MD5 hash of object

func (*GSctx) GetObjectMetaData

func (s *GSctx) GetObjectMetaData(bname, bkey string) (int64, string, error)

GetObjectMetaData located in Google Storage

func (*GSctx) GetObjectSize

func (s *GSctx) GetObjectSize(bname, bkey string) (int64, error)

GetObjectSize returns the size of object in bytes

func (*GSctx) IsBucketAvailable

func (s *GSctx) IsBucketAvailable(bname string) (bool, error)

IsBucketAvailable checks if the bucket with the given name available

func (*GSctx) ListImages

func (s *GSctx) ListImages(bname string, prgNotify types.StatsNotifChan) ([]string, error)

ListImages in Google Storage

func (*GSctx) UploadFile

func (s *GSctx) UploadFile(fname, bname, bkey string, compression bool, prgNotify types.StatsNotifChan) (string, error)

UploadFile to Google Storage

type Resp

type Resp struct {
	Name string
	List []string //list of images at given path
}

Resp structure for response

Jump to

Keyboard shortcuts

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