Documentation ¶
Index ¶
- type ObjectOption
- type Storage
- func (s *Storage) Attrs(opt ObjectOption) (*GCP.ObjectAttrs, error)
- func (s *Storage) Delete(opt ObjectOption) error
- func (s *Storage) Download(opt ObjectOption) (data []byte, err error)
- func (s *Storage) Errorf(format string, vv ...interface{})
- func (s *Storage) IsExists(opt ObjectOption) (isExist bool, err error)
- func (s *Storage) Rename(destPath string, opt ObjectOption) error
- func (s *Storage) SetLogger(logger log.Logger)
- func (s *Storage) Upload(r io.Reader, opt ObjectOption) error
- func (s *Storage) UploadByBytes(byt []byte, opt ObjectOption) error
- func (s *Storage) UploadByFile(filepath string, opt ObjectOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectOption ¶
type ObjectOption struct { BucketName string Path string MaxResult int64 Projection string Context context.Context }
ObjectOption is optional parameters used for object call.
type Storage ¶
Storage repesents Cloud Storage API client.
func (*Storage) Attrs ¶
func (s *Storage) Attrs(opt ObjectOption) (*GCP.ObjectAttrs, error)
Attrs gets attributes of the object.
func (*Storage) Download ¶
func (s *Storage) Download(opt ObjectOption) (data []byte, err error)
Download downloads object data.
func (*Storage) IsExists ¶
func (s *Storage) IsExists(opt ObjectOption) (isExist bool, err error)
IsExists checks if an object exists.
func (*Storage) Rename ¶ added in v0.4.1
func (s *Storage) Rename(destPath string, opt ObjectOption) error
Rename moves an object from opt.Path to destPath..
func (*Storage) Upload ¶
func (s *Storage) Upload(r io.Reader, opt ObjectOption) error
Upload uploads an object from io.Reader.
func (*Storage) UploadByBytes ¶
func (s *Storage) UploadByBytes(byt []byte, opt ObjectOption) error
UploadByBytes uploads an object from bytes.
func (*Storage) UploadByFile ¶
func (s *Storage) UploadByFile(filepath string, opt ObjectOption) error
UploadByFile uploads an object from bytes.
Click to show internal directories.
Click to hide internal directories.