| @@ -12,6 +12,10 @@ func New() *ShardStorePool { | |||||
| } | } | ||||
| func (p *ShardStorePool) PutNew(stg cdssdk.Storage, config cdssdk.ShardStoreConfig) error { | |||||
| } | |||||
| func (p *ShardStorePool) Get(stgID cdssdk.StorageID) (types.ShardStore, error) { | func (p *ShardStorePool) Get(stgID cdssdk.StorageID) (types.ShardStore, error) { | ||||
| } | } | ||||
| @@ -1,12 +0,0 @@ | |||||
| package local | |||||
| import "gitlink.org.cn/cloudream/storage/common/pkgs/shardstore/types" | |||||
| type Config struct { | |||||
| RootPath string | |||||
| MaxSize int64 | |||||
| } | |||||
| func (c *Config) Build() types.ShardStore { | |||||
| return &Local{cfg: *c} | |||||
| } | |||||
| @@ -3,11 +3,18 @@ package local | |||||
| import ( | import ( | ||||
| "io" | "io" | ||||
| "gitlink.org.cn/cloudream/storage/common/pkgs/shardstore/types" | |||||
| cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| "gitlink.org.cn/cloudream/storage/common/pkgs/storage/shard/types" | |||||
| ) | ) | ||||
| type Local struct { | type Local struct { | ||||
| cfg Config | |||||
| cfg cdssdk.LocalShardStorage | |||||
| } | |||||
| func New(stg cdssdk.Storage, cfg cdssdk.LocalShardStorage) *Local { | |||||
| return &Local{ | |||||
| cfg: cfg, | |||||
| } | |||||
| } | } | ||||
| func (s *Local) New() io.Writer { | func (s *Local) New() io.Writer { | ||||
| @@ -24,7 +31,11 @@ func (s *Local) Remove(hash types.FileHash) error { | |||||
| } | } | ||||
| // 遍历所有文件,callback返回false则停止遍历 | // 遍历所有文件,callback返回false则停止遍历 | ||||
| func (s *Local) Walk(callback func(info types.FileInfo) bool) error { | |||||
| func (s *Local) ListAll() ([]types.FileInfo, error) { | |||||
| } | |||||
| func (s *Local) Purge(availables []types.FileHash) error { | |||||
| } | } | ||||
| @@ -0,0 +1,13 @@ | |||||
| package tempstore | |||||
| import cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| type LocalTempStore struct { | |||||
| cfg cdssdk.BypassUploadFeature | |||||
| } | |||||
| func NewLocalTempStore(cfg cdssdk.BypassUploadFeature) *LocalTempStore { | |||||
| return &LocalTempStore{ | |||||
| cfg: cfg, | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,4 @@ | |||||
| package tempstore | |||||
| type TempStore interface { | |||||
| } | |||||