Documentation
¶
Index ¶
- type CustomReader
- type CustomWriter
- type GSctx
- func (s *GSctx) CreateBucket(bname string) error
- func (s *GSctx) DeleteBucket(bname string) error
- func (s *GSctx) DeleteObject(bname, bkey string) error
- func (s *GSctx) DownloadFile(fname, bname, bkey string, bsize int64, prgNotify types.StatsNotifChan) error
- func (s *GSctx) GetObjectMD5(bname, bkey string) (string, error)
- func (s *GSctx) GetObjectMetaData(bname, bkey string) (int64, string, error)
- func (s *GSctx) GetObjectSize(bname, bkey string) (int64, error)
- func (s *GSctx) IsBucketAvailable(bname string) (bool, error)
- func (s *GSctx) ListImages(bname string, prgNotify types.StatsNotifChan) ([]string, error)
- func (s *GSctx) UploadFile(fname, bname, bkey string, compression bool, prgNotify types.StatsNotifChan) (string, error)
- type Resp
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
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
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 ¶
CreateBucket creates bucket with the given name
func (*GSctx) DeleteBucket ¶
DeleteBucket removes the bucket
func (*GSctx) DeleteObject ¶
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 ¶
GetObjectMD5 returns hex string of MD5 hash of object
func (*GSctx) GetObjectMetaData ¶
GetObjectMetaData located in Google Storage
func (*GSctx) GetObjectSize ¶
GetObjectSize returns the size of object in bytes
func (*GSctx) IsBucketAvailable ¶
IsBucketAvailable checks if the bucket with the given name available
func (*GSctx) ListImages ¶
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