Documentation ¶
Index ¶
- Constants
- Variables
- func DrainFn(c <-chan interface{})
- type StorMgr
- func (sto *StorMgr) GetBucketFileData(ctx context.Context, bucketName string, fileName string) ([]byte, error)
- func (sto *StorMgr) ListBucket(ctx context.Context, bucketName, prefix string, bufferSize int) (<-chan interface{}, error)
- func (sto *StorMgr) ListBucketByTime(ctx context.Context, bucketName, prefix string, start, end *time.Time, ...) (<-chan interface{}, error)
- func (sto *StorMgr) RemoveFile(ctx context.Context, bucketName string, fileName string) error
- func (sto *StorMgr) WriteBucketFile(ctx context.Context, bucketName string, fileName string, data []byte) error
Constants ¶
View Source
const ( //ObjAttrName is the object name ObjAttrName = "name" //ObjAttrContentType is the content type ObjAttrContentType = "contenttype" //ObjAttrOwner is the GCP owner account ObjAttrOwner = "owner" //ObjAttrSize is the size of the object ObjAttrSize = "size" //ObjAttrContentEncoding is the file encoding ObjAttrContentEncoding = "contentencoding" //ObjAttrCreated created timestamp ObjAttrCreated = "created" )
Variables ¶
View Source
var ( //EnvDebugOn controls verbose logging EnvDebugOn bool //EnvClientPool is the size of the client pool EnvClientPool int )
View Source
var ( //ErrMissingDateRange message ErrMissingDateRange = errors.New("start and end dates must be supplied") )
Functions ¶
Types ¶
type StorMgr ¶
type StorMgr struct {
// contains filtered or unexported fields
}
StorMgr handles interactions with GCS
func NewJSONMgr ¶
NewJSONMgr returns a new storage manager based on a GCP credential supplied as a byte array
func (*StorMgr) GetBucketFileData ¶
func (sto *StorMgr) GetBucketFileData(ctx context.Context, bucketName string, fileName string) ([]byte, error)
GetBucketFileData returns a byte array for a bucket file
func (*StorMgr) ListBucket ¶
func (sto *StorMgr) ListBucket(ctx context.Context, bucketName, prefix string, bufferSize int) (<-chan interface{}, error)
ListBucket returns a configurable buffered channel which contains a subset of object metadata
func (*StorMgr) ListBucketByTime ¶
func (sto *StorMgr) ListBucketByTime(ctx context.Context, bucketName, prefix string, start, end *time.Time, bufferSize int) (<-chan interface{}, error)
ListBucketByTime returns a configurable buffered channel which contains a subset of object metadata
func (*StorMgr) RemoveFile ¶
RemoveFile deletes a bucket file
Click to show internal directories.
Click to hide internal directories.