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 tempDir string
token *byte token *byte
sc *config.StorageConfig
} }
func (lmem *lockedMemRepo) GetStorage() (config.StorageConfig, error) { func (lmem *lockedMemRepo) GetStorage() (config.StorageConfig, error) {
return config.StorageConfig{StoragePaths: []config.LocalPath{ if lmem.sc == nil {
{Path: lmem.Path()}, lmem.sc = &config.StorageConfig{StoragePaths: []config.LocalPath{
}}, nil {Path: lmem.Path()},
}}
}
return *lmem.sc, nil
} }
func (lmem *lockedMemRepo) SetStorage(config.StorageConfig) error { func (lmem *lockedMemRepo) SetStorage(sc config.StorageConfig) error {
panic("implement me") lmem.sc = &sc
return nil
} }
func (lmem *lockedMemRepo) Path() string { func (lmem *lockedMemRepo) Path() string {