Documentation
¶
Index ¶
- func Backup(ctx context.Context, s Storage, prefix string, w io.Writer) error
- func Restore(ctx context.Context, s Storage, destPrefix string, r io.Reader) error
- type FileInfo
- type ListOptions
- type Local
- func (l *Local) Delete(ctx context.Context, path string) error
- func (l *Local) DeletePrefix(ctx context.Context, prefix string) error
- func (l *Local) Get(ctx context.Context, path string) (io.ReadCloser, *FileInfo, error)
- func (l *Local) List(ctx context.Context, opts ListOptions) ([]FileInfo, error)
- func (l *Local) MakeDir(ctx context.Context, path string) error
- func (l *Local) Put(ctx context.Context, path string, r io.Reader, size int64, contentType string) error
- func (l *Local) RemoveDir(ctx context.Context, path string) error
- func (l *Local) Stat(ctx context.Context, path string) (*FileInfo, error)
- type Manager
- type MinIOConfig
- type MinIOStorage
- func (m *MinIOStorage) Delete(ctx context.Context, path string) error
- func (m *MinIOStorage) DeletePrefix(ctx context.Context, prefix string) error
- func (m *MinIOStorage) Get(ctx context.Context, path string) (io.ReadCloser, *FileInfo, error)
- func (m *MinIOStorage) List(ctx context.Context, opts ListOptions) ([]FileInfo, error)
- func (m *MinIOStorage) MakeDir(ctx context.Context, path string) error
- func (m *MinIOStorage) Put(ctx context.Context, path string, r io.Reader, size int64, contentType string) error
- func (m *MinIOStorage) RemoveDir(ctx context.Context, path string) error
- func (m *MinIOStorage) Stat(ctx context.Context, path string) (*FileInfo, error)
- type S3Config
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, path string) error
- func (s *S3Storage) DeletePrefix(ctx context.Context, prefix string) error
- func (s *S3Storage) Get(ctx context.Context, path string) (io.ReadCloser, *FileInfo, error)
- func (s *S3Storage) List(ctx context.Context, opts ListOptions) ([]FileInfo, error)
- func (s *S3Storage) MakeDir(ctx context.Context, path string) error
- func (s *S3Storage) Put(ctx context.Context, path string, r io.Reader, size int64, contentType string) error
- func (s *S3Storage) RemoveDir(ctx context.Context, path string) error
- func (s *S3Storage) Stat(ctx context.Context, path string) (*FileInfo, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ListOptions ¶
ListOptions control listing behavior
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local implements Storage using the local filesystem
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides named drivers and default storage
type MinIOConfig ¶
type MinIOStorage ¶
type MinIOStorage struct {
// contains filtered or unexported fields
}
func NewMinIOStorage ¶
func NewMinIOStorage(ctx context.Context, cfg MinIOConfig) (*MinIOStorage, error)
func (*MinIOStorage) DeletePrefix ¶
func (m *MinIOStorage) DeletePrefix(ctx context.Context, prefix string) error
func (*MinIOStorage) Get ¶
func (m *MinIOStorage) Get(ctx context.Context, path string) (io.ReadCloser, *FileInfo, error)
func (*MinIOStorage) List ¶
func (m *MinIOStorage) List(ctx context.Context, opts ListOptions) ([]FileInfo, error)
func (*MinIOStorage) MakeDir ¶
func (m *MinIOStorage) MakeDir(ctx context.Context, path string) error
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func (*S3Storage) DeletePrefix ¶
type Storage ¶
type Storage interface {
// Put stores data at path. Creates directories if needed
Put(ctx context.Context, path string, r io.Reader, size int64, contentType string) error
// Get returns a ReadCloser for path
Get(ctx context.Context, path string) (io.ReadCloser, *FileInfo, error)
// Stat returns metadata for path
Stat(ctx context.Context, path string) (*FileInfo, error)
// Delete removes a single file
Delete(ctx context.Context, path string) error
// DeletePrefix removes all files under a prefix
DeletePrefix(ctx context.Context, prefix string) error
// List lists files under a prefix
List(ctx context.Context, opts ListOptions) ([]FileInfo, error)
// MakeDir creates a folder (no-op for object stores)
MakeDir(ctx context.Context, path string) error
// RemoveDir removes a folder (best-effort)
RemoveDir(ctx context.Context, path string) error
}
Storage abstracts file storage operations
Click to show internal directories.
Click to hide internal directories.