repo: Implement memrepo.SetStorage

This commit is contained in:
Łukasz Magiera 2020-03-09 07:21:42 +01:00
parent 33fcf8eb44
commit 1cf26fc652

View File

@ -40,16 +40,22 @@ type lockedMemRepo struct {
tempDir string
token *byte
sc *config.StorageConfig
}
func (lmem *lockedMemRepo) GetStorage() (config.StorageConfig, error) {
return config.StorageConfig{StoragePaths: []config.LocalPath{
{Path: lmem.Path()},
}}, nil
if lmem.sc == nil {
lmem.sc = &config.StorageConfig{StoragePaths: []config.LocalPath{
{Path: lmem.Path()},
}}
}
return *lmem.sc, nil
}
func (lmem *lockedMemRepo) SetStorage(config.StorageConfig) error {
panic("implement me")
func (lmem *lockedMemRepo) SetStorage(sc config.StorageConfig) error {
lmem.sc = &sc
return nil
}
func (lmem *lockedMemRepo) Path() string {