Documentation ¶
Index ¶
- type DefaultObjectStorage
- func (s DefaultObjectStorage) CreateBucket(ctx context.Context) error
- func (s DefaultObjectStorage) ListAllObjects(ctx context.Context, prefix, marker string) (<-chan Object, error)
- func (s DefaultObjectStorage) ListObjects(ctx context.Context, prefix, marker, delimiter string, limit int64) ([]Object, error)
- type Object
- type ObjectStorage
- type ObjectStorageConfig
- type PieceStoreConfig
- type SessionCache
- type StorageFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultObjectStorage ¶
type DefaultObjectStorage struct{}
func (DefaultObjectStorage) CreateBucket ¶
func (s DefaultObjectStorage) CreateBucket(ctx context.Context) error
func (DefaultObjectStorage) ListAllObjects ¶
func (DefaultObjectStorage) ListObjects ¶
type ObjectStorage ¶
type ObjectStorage interface { // String the description of an object storage String() string // CreateBucket create the bucket if not existed CreateBucket(ctx context.Context) error // GetObject gets data for the given object specified by key GetObject(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error) // PutObject puts data read from a reader to an object specified by key PutObject(ctx context.Context, key string, reader io.Reader) error // DeleteObject deletes an object DeleteObject(ctx context.Context, key string) error // HeadBucket determines if a bucket exists and have permission to access it HeadBucket(ctx context.Context) error // HeadObject returns some information about the object or an error if not found HeadObject(ctx context.Context, key string) (Object, error) // ListObjects lists returns a list of objects ListObjects(ctx context.Context, prefix, marker, delimiter string, limit int64) ([]Object, error) // ListAllObjects returns all the objects as a channel ListAllObjects(ctx context.Context, prefix, marker string) (<-chan Object, error) }
ObjectStorage is a common interface that must be implemented if some users want to use an object storage (such as S3, Azure Blob, Minio, OSS, COS, etc)
func NewObjectStorage ¶
func NewObjectStorage(cfg ObjectStorageConfig) (ObjectStorage, error)
func NewSharded ¶
func NewSharded(cfg PieceStoreConfig) (ObjectStorage, error)
type ObjectStorageConfig ¶
type ObjectStorageConfig struct { Storage string // backend storage type (e.g. s3, file, memory) BucketURL string // the bucket URL of object storage to store data MaxRetries int // the number of max retries that will be performed MinRetryDelay int64 // the minimum retry delay after which retry will be performed TLSInsecureSkipVerify bool // whether skip the certificate verification of HTTPS requests IAMType string // IAMType is identity and access management type which contains two types: AKSKIAMType/SAIAMType }
ObjectStorageConfig object storage config
type PieceStoreConfig ¶
type PieceStoreConfig struct { Shards int // store the blocks into N buckets by hash of key Store ObjectStorageConfig // config of object storage }
PieceStoreConfig contains some parameters which are used to run PieceStore
type SessionCache ¶
SessionCache holds session.Session according to ObjectStorageConfig and it synchronizes access/modification
type StorageFn ¶
type StorageFn func(cfg ObjectStorageConfig) (ObjectStorage, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.