Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureFolder(prefix string, settings map[string]string) (storage.Folder, error)
- func NewError(err error, format string, args ...interface{}) storage.Error
- type Folder
- func (folder *Folder) BuildObjectHandle(path string) *gcs.ObjectHandle
- func (folder *Folder) DeleteObjects(objectRelativePaths []string) error
- func (folder *Folder) Exists(objectRelativePath string) (bool, error)
- func (folder *Folder) GetPath() string
- func (folder *Folder) GetSubFolder(subFolderRelativePath string) storage.Folder
- func (folder *Folder) ListFolder() (objects []storage.Object, subFolders []storage.Folder, err error)
- func (folder *Folder) PutObject(name string, content io.Reader) error
- func (folder *Folder) ReadObject(objectRelativePath string) (io.ReadCloser, error)
- type Uploader
- type UploaderOption
Constants ¶
View Source
const ( ContextTimeout = "GCS_CONTEXT_TIMEOUT" NormalizePrefix = "GCS_NORMALIZE_PREFIX" EncryptionKey = "GCS_ENCRYPTION_KEY" MaxChunkSize = "GCS_MAX_CHUNK_SIZE" MaxRetries = "GCS_MAX_RETRIES" )
Variables ¶
View Source
var ( // BaseRetryDelay defines the first delay for retry. BaseRetryDelay = 128 * time.Millisecond // SettingList provides a list of GCS folder settings. SettingList = []string{ ContextTimeout, NormalizePrefix, EncryptionKey, MaxChunkSize, MaxRetries, } )
Functions ¶
func ConfigureFolder ¶
Types ¶
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder represents folder in GCP
func NewFolder ¶
func NewFolder(bucket *gcs.BucketHandle, path string, contextTimeout int, normalizePrefix bool, encryptionKey []byte, options []UploaderOption) *Folder
func (*Folder) BuildObjectHandle ¶
func (folder *Folder) BuildObjectHandle(path string) *gcs.ObjectHandle
BuildObjectHandle creates a new object handle.
func (*Folder) DeleteObjects ¶
func (*Folder) GetSubFolder ¶
func (*Folder) ListFolder ¶
func (*Folder) ReadObject ¶
func (folder *Folder) ReadObject(objectRelativePath string) (io.ReadCloser, error)
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func NewUploader ¶
func NewUploader(objHandle *storage.ObjectHandle, options ...UploaderOption) *Uploader
func (*Uploader) CleanUpChunks ¶
func (u *Uploader) CleanUpChunks(ctx context.Context, tmpChunks []*storage.ObjectHandle)
CleanUpChunks removes temporary chunks.
func (*Uploader) ComposeObject ¶
ComposeObject composes an object from temporary chunks.
type UploaderOption ¶
type UploaderOption func(*Uploader)
Click to show internal directories.
Click to hide internal directories.