Documentation ¶
Overview ¶
Package oss is used to implement the AliCloud-Object-Storage-Service storage medium for the underlying data and indexes.
Index ¶
- Constants
- func CreateBucket(client *oss.Client, bucketName string) error
- func DefaultClient() (*oss.Client, error)
- func DeleteObject(client *oss.Client, bucketName, object string) error
- func DeleteObjects(client *oss.Client, bucketName string, objects []string) error
- func GetBucket(client *oss.Client, bucketName string) (*oss.Bucket, error)
- func GetObject(client *oss.Client, bucketName, path string, minimumConcurrencyLoadSize int) ([]byte, error)
- func GetObjectConcurrency(bucket *oss.Bucket, size int, path string) ([]byte, error)
- func GetObjectOrdinary(bucket *oss.Bucket, path string) ([]byte, error)
- func IsBucketExist(client *oss.Client, bucketName string) (bool, error)
- func ListObjects(client *oss.Client, bucketName, prefix string) ([]oss.ObjectProperties, error)
- func NewClient(endpoint, accessKeyID, secretAccessKey string) (*oss.Client, error)
- func OssPath(index string) string
- func PutObject(client *oss.Client, bucketName, path string, buf *bytes.Buffer) error
- type OssDirectory
- func (d *OssDirectory) List(kind string) ([]uint64, error)
- func (d *OssDirectory) Load(kind string, id uint64) (ret *segment.Data, closer io.Closer, err error)
- func (d *OssDirectory) Lock() error
- func (d *OssDirectory) Persist(kind string, id uint64, w index.WriterTo, closeCh chan struct{}) error
- func (d *OssDirectory) Remove(kind string, id uint64) error
- func (d *OssDirectory) Setup(readOnly bool) error
- func (d *OssDirectory) Stats() (numFilesOnDisk, numBytesUsedDisk uint64)
- func (d *OssDirectory) Sync() error
- func (d *OssDirectory) Unlock() error
Constants ¶
View Source
const MaxKeySize = 1000
Variables ¶
This section is empty.
Functions ¶
func DefaultClient ¶
func DeleteObjects ¶
func GetObjectConcurrency ¶
func ListObjects ¶
Types ¶
type OssDirectory ¶
type OssDirectory struct {
// contains filtered or unexported fields
}
func NewOssDirectory ¶
func NewOssDirectory( endpoint, bucket, accessKeyID, secretAccessKey, index, cacheDir string, minimumConcurrencyLoadSize int, ) *OssDirectory
func (*OssDirectory) Lock ¶
func (d *OssDirectory) Lock() error
Lock ensures this process has exclusive access to write in this directory. We plan to restrict an OssDirectory to be accessed by at most one process at the same time through the first-level shard strategy (shard).
func (*OssDirectory) Setup ¶
func (d *OssDirectory) Setup(readOnly bool) error
func (*OssDirectory) Stats ¶
func (d *OssDirectory) Stats() (numFilesOnDisk, numBytesUsedDisk uint64)
func (*OssDirectory) Sync ¶
func (d *OssDirectory) Sync() error
func (*OssDirectory) Unlock ¶
func (d *OssDirectory) Unlock() error
Unlock releases the lock held on this directory. We plan to restrict an OssDirectory to be accessed by at most one process at the same time through the first-level shard strategy (shard).
Click to show internal directories.
Click to hide internal directories.