Documentation ¶
Index ¶
- Variables
- func BenchmarkStorageProvider(storage StorageProvider, b *testing.B)
- func TeardownTestEnv() error
- func TestStorageProvider(provider StorageProvider, t *testing.T)
- type File
- type FileInfo
- type PostConfigure
- type ReadonlyStorage
- func (r *ReadonlyStorage) Delete(ctx context.Context, user *models.User, fullpath string) error
- func (r *ReadonlyStorage) File(ctx context.Context, user *models.User, fullpath string) (File, error)
- func (r *ReadonlyStorage) InitUser(ctx context.Context, user *models.User) error
- func (r *ReadonlyStorage) ListDirectory(ctx context.Context, user *models.User, path string) (<-chan FileInfo, error)
- func (r *ReadonlyStorage) Mkdir(ctx context.Context, user *models.User, path string) error
- func (r *ReadonlyStorage) Move(ctx context.Context, user *models.User, src string, dst string) error
- type StorageProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReadOnly = errors.New("Readonly storage")
Functions ¶
func BenchmarkStorageProvider ¶
func BenchmarkStorageProvider(storage StorageProvider, b *testing.B)
func TeardownTestEnv ¶
func TeardownTestEnv() error
func TestStorageProvider ¶
func TestStorageProvider(provider StorageProvider, t *testing.T)
Types ¶
type File ¶
type File interface { io.ReadCloser io.WriteCloser }
type PostConfigure ¶
type PostConfigure interface {
OnConfigure() error
}
Implement this interface if you want to be notified after your config is loaded, in case you need to do additional initialization using the config values
type ReadonlyStorage ¶
type ReadonlyStorage struct {
// contains filtered or unexported fields
}
func (*ReadonlyStorage) ListDirectory ¶
type StorageProvider ¶
type StorageProvider interface { InitUser(ctx context.Context, user *models.User) error Mkdir(ctx context.Context, user *models.User, path string) error Move(ctx context.Context, user *models.User, src, dst string) error ListDirectory(ctx context.Context, user *models.User, path string) (<-chan FileInfo, error) File(ctx context.Context, user *models.User, fullpath string) (File, error) Delete(ctx context.Context, user *models.User, fullpath string) error }
TODO: Add support for https://pkg.go.dev/io#ReaderAt and https://pkg.go.dev/io#WriterAt ?
func ReadOnly ¶
func ReadOnly(provider StorageProvider) StorageProvider
func SetupTestEnv ¶
func SetupTestEnv(provider StorageProvider, tmpdir string) (StorageProvider, error)
Click to show internal directories.
Click to hide internal directories.