Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LockedKey contains the key for indication if an object is locked LockedKey = "locked" // LockedValue contains the value for indicating it's locked LockedValue = "true" )
View Source
const (
// MaxChunkBytes contains the maximum number of bytes in a chunk (for Read/Write streaming operations)
MaxChunkBytes = 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketFolderCounter ¶
type BucketFolderCounter struct {
// contains filtered or unexported fields
}
BucketFolderCounter is able to count "folder"s within buckets.
func NewBucketFolderCounter ¶
func NewBucketFolderCounter(basePath string) BucketFolderCounter
NewBucketFolderCounter creates a new BucketFolderCounter.
func (BucketFolderCounter) AddObject ¶
func (b BucketFolderCounter) AddObject(obj string)
AddObject extracts the folder names in the passed object name and adds them into the folders map.
func (BucketFolderCounter) GetFolderCount ¶
func (b BucketFolderCounter) GetFolderCount() int32
GetFolderCount returns the number of folders within a bucket. Excludes the basePath.
type Configuration ¶
type InputWriter ¶
type InputWriter interface {
// WriteInput writes the next chunk into the bucket object.
// Returns: moreDataAllowed, error
WriteInput(ctx context.Context, chunk []byte, hasMore bool) (bool, error)
// Close the underlying object
Close() error
}
InputWriter abstracts the implementation of input writers.
func NewBucketInputWriter ¶
func NewBucketInputWriter(log logging.Logger, pipeWriter *io.PipeWriter, encryptionKey []byte, uploadDone *sync.Mutex) (InputWriter, error)
NewBucketInputWriter creates a BucketInputWriter
type ObjectInfo ¶
type ObjectInfo struct {
// Indicates if the object exists
Exists bool
// Indicates if the object is locked
// This info is only relevant if the object exists
IsLocked bool
// Indicates the size of the object in bytes
// This info is only relevant if the object exists
SizeInBytes uint64
// The timestamp this object has last been modified
LastUpdatedAt time.Time
// The tags associated with this object, if any
Tags pbCommon.KeyValuePairList
}
ObjectInfo is the response type for the GetObjectInfo method
type OutputReader ¶
type OutputReader interface {
// ReadOutput fetches the next chunk available for the bucket object with given info.
// Returns: chunk, moreData, error
// If an empty chunk is returned and moreData is true, more data is expected.
ReadOutput(ctx context.Context) ([]byte, bool, error)
}
OutputReader abstracts the implementation of output readers.
func NewBucketOutputReader ¶
func NewBucketOutputReader(log logging.Logger, readCloser io.ReadCloser, encryptionKey []byte) (OutputReader, error)
NewBucketOutputReader create a BucketOutputReader
type ShutdownableBucketServiceServer ¶
type ShutdownableBucketServiceServer interface {
pbStorage.BucketServiceServer
svc.Handler
svc.Shutdown
}
func NewS3Impl ¶
func NewS3Impl(cfg Configuration) (ShutdownableBucketServiceServer, error)
Click to show internal directories.
Click to hide internal directories.