Implement Read Only mode
This commit is contained in:
parent
6464d92dd4
commit
e1bd235785
19 changed files with 544 additions and 335 deletions
26
lib/storage/ro.go
Normal file
26
lib/storage/ro.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
)
|
||||
|
||||
type roStore struct {
|
||||
store Store
|
||||
}
|
||||
|
||||
func (st *roStore) Create(id string, name string) (io.WriteCloser, error) {
|
||||
return nil, errors.New("Can't create, RO storage")
|
||||
}
|
||||
|
||||
func (st *roStore) Store(id string, file io.Reader, name string) (size int64, err error) {
|
||||
return 0, errors.New("Can't store, RO storage")
|
||||
}
|
||||
|
||||
func (st *roStore) Get(id string, name string) (File, error) {
|
||||
return st.store.Get(id, name)
|
||||
}
|
||||
|
||||
func (st *roStore) Delete(id string) error {
|
||||
return errors.New("Can't delete, RO storage")
|
||||
}
|
Reference in a new issue