Documentation ¶
Index ¶
- Constants
- Variables
- func NewEtcdCli(c *conf.Data) *eCli.Client
- func NewEtcdRepo(data *Data, logger log.Logger) biz.EtcdRepo
- func NewLevelDBRepo(conf *conf.Data, leveldb *leveldb.DB, logger log.Logger) biz.LevelDBRepo
- func NewOssRepo(data *Data, logger log.Logger) biz.OssRepo
- func NewRedisCli(c *conf.Data) *redis.Client
- func NewS3Cli(c *conf.Data) *s3.S3
- func NewS3Storage(opt OpenOption) (storage.Storage, error)
- type Config
- type Data
- type LevelDB
- type OpenOption
- type S3Client
- type S3Storage
- func (ms *S3Storage) Close() error
- func (ms *S3Storage) Create(fd storage.FileDesc) (storage.Writer, error)
- func (ms *S3Storage) GetMeta() (storage.FileDesc, error)
- func (ms *S3Storage) List(ft storage.FileType) ([]storage.FileDesc, error)
- func (ms *S3Storage) Lock() (storage.Locker, error)
- func (*S3Storage) Log(str string)
- func (ms *S3Storage) Open(fd storage.FileDesc) (storage.Reader, error)
- func (ms *S3Storage) Remove(fd storage.FileDesc) error
- func (ms *S3Storage) Rename(oldfd, newfd storage.FileDesc) error
- func (ms *S3Storage) SetMeta(fd storage.FileDesc) error
- type S3StorageLock
Constants ¶
View Source
const ( KiB = 1024 MiB = KiB * 1024 GiB = MiB * 1024 )
View Source
const CacheSize = 500
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewData, NewEtcdRepo, NewEtcdCli, NewLevelDBRepo, NewS3Cli, NewOssRepo, NewRedisCli)
ProviderSet is data providers.
Functions ¶
func NewLevelDBRepo ¶
NewLevelRepo .
func NewRedisCli ¶
func NewS3Storage ¶
func NewS3Storage(opt OpenOption) (storage.Storage, error)
NewS3Storage 返回一个基于S3接口的存储实现
Types ¶
type Config ¶
type Config struct { Endpoint string MasterIp []string Ak string Sk string Region string DataDir string LocationCacheDir string }
配置文件结构
type OpenOption ¶
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage is a s3-backed storage.
type S3StorageLock ¶
type S3StorageLock struct {
// contains filtered or unexported fields
}
func (*S3StorageLock) Unlock ¶
func (lock *S3StorageLock) Unlock()
Click to show internal directories.
Click to hide internal directories.