Documentation
¶
Index ¶
- Constants
- Variables
- func CopyFile(dest Store, destName string, source Store, sourceName string) error
- func Dump(store Store, dir string, content bool) string
- func LoadTestURLs(filename string) (urls map[string]string)
- func Lock(s Store, dir, lockType string, timeout time.Duration) (release chan bool, err error)
- func ReadFile(s Store, name string) ([]byte, error)
- func ReadJSON(s Store, name string, v any, hash hash.Hash) error
- func ReadMsgPack(s Store, name string, v any) error
- func ReadYAML(s Store, name string, v interface{}, hash hash.Hash) error
- func WriteFile(s Store, name string, data []byte) error
- func WriteJSON(s Store, name string, v any, hash hash.Hash) error
- func WriteMsgPack(s Store, name string, v any) error
- func WriteYAML(s Store, name string, v interface{}, hash hash.Hash) error
- type Description
- type Filter
- type ListOption
- type Local
- func (l *Local) Close() error
- func (l *Local) Delete(name string) error
- func (l *Local) Describe() Description
- func (l *Local) Read(name string, rang *Range, dest io.Writer, progress chan int64) error
- func (l *Local) ReadDir(dir string, filter Filter) ([]fs.FileInfo, error)
- func (l *Local) Rename(old, new string) error
- func (l *Local) Stat(name string) (os.FileInfo, error)
- func (l *Local) String() string
- func (l *Local) Url() string
- func (l *Local) Write(name string, source io.ReadSeeker, progress chan int64) error
- type LocalConfig
- type Memory
- func (m *Memory) Close() error
- func (m *Memory) Delete(name string) error
- func (m *Memory) Describe() Description
- func (m *Memory) Read(name string, rang *Range, dest io.Writer, progress chan int64) error
- func (m *Memory) ReadDir(dir string, f Filter) ([]fs.FileInfo, error)
- func (m *Memory) Stat(name string) (os.FileInfo, error)
- func (m *Memory) String() string
- func (m *Memory) Url() string
- func (m *Memory) Write(name string, source io.ReadSeeker, progress chan int64) error
- type Range
- type S3
- func (s *S3) Close() error
- func (s *S3) Delete(name string) error
- func (*S3) Describe() Description
- func (s *S3) Read(name string, rang *Range, dest io.Writer, progress chan int64) error
- func (s *S3) ReadDir(dir string, f Filter) ([]fs.FileInfo, error)
- func (s *S3) Rename(old, new string) error
- func (s *S3) Stat(name string) (fs.FileInfo, error)
- func (s *S3) String() string
- func (s *S3) Url() string
- func (s *S3) Write(name string, source io.ReadSeeker, progress chan int64) error
- type SFTP
- func (s *SFTP) Close() error
- func (s *SFTP) Delete(name string) error
- func (*SFTP) Describe() Description
- func (s *SFTP) Read(name string, rang *Range, dest io.Writer, progress chan int64) error
- func (s *SFTP) ReadDir(dir string, f Filter) ([]fs.FileInfo, error)
- func (s *SFTP) Rename(old, new string) error
- func (s *SFTP) Stat(name string) (os.FileInfo, error)
- func (s *SFTP) String() string
- func (s *SFTP) Url() string
- func (s *SFTP) Write(name string, source io.ReadSeeker, progress chan int64) error
- type Source
- type Store
- func EncryptNames(s Store, key []byte, nonce []byte, propagateClose bool) Store
- func NewTestStore(id string) Store
- func Open(connectionUrl string) (Store, error)
- func OpenLocal(connectionUrl string) (Store, error)
- func OpenMemory(connectionUrl string) (Store, error)
- func OpenS3(connectionUrl string) (Store, error)
- func OpenSFTP(connectionUrl string) (Store, error)
- func OpenWebDAV(connectionUrl string) (Store, error)
- func Sub(s Store, base string, propagateClose bool) Store
- type WebDAV
- func (w *WebDAV) Close() error
- func (w *WebDAV) Delete(name string) error
- func (w *WebDAV) Describe() Description
- func (w *WebDAV) Read(name string, rang *Range, dest io.Writer, progress chan int64) error
- func (w *WebDAV) ReadDir(dir string, f Filter) ([]fs.FileInfo, error)
- func (w *WebDAV) Rename(old, new string) error
- func (w *WebDAV) Stat(name string) (fs.FileInfo, error)
- func (w *WebDAV) String() string
- func (w *WebDAV) Url() string
- func (w *WebDAV) Write(name string, source io.ReadSeeker, progress chan int64) error
Constants ¶
View Source
const LockDir = ".lock"
View Source
const LockExpire = 10 * time.Second
View Source
const SizeAll = -1
Variables ¶
View Source
var MemoryStores = map[string]*Memory{}
View Source
var SampleConfig = []string{
"sftp://username:password@hostname?key=key",
"s3://accessKey:secret@s3.eu-central-1.amazonaws.com/bucket",
"file://path",
}
Functions ¶
func LoadTestURLs ¶
Types ¶
type Description ¶
type Filter ¶
type Filter struct { Prefix string //Prefix filters on results starting with prefix Suffix string //Suffix filters on results ending with suffix AfterName string //After ignore all results before the provided one and the provided one After time.Time //After ignore all results before the provided one and the provided one MaxResults int64 //MaxResults limits the number of results returned OnlyFiles bool //OnlyFiles returns only files OnlyFolders bool //OnlyFolders returns only folders Function func(fs.FileInfo) bool //Function filters on a custom function }
type ListOption ¶
type ListOption uint32
const ( // IncludeHiddenFiles includes hidden files in a list operation IncludeHiddenFiles ListOption = 1 )
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (*Local) Describe ¶
func (l *Local) Describe() Description
type LocalConfig ¶
type LocalConfig struct {
Base string `json:"base" yaml:"base"`
}
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) Describe ¶
func (m *Memory) Describe() Description
type Store ¶
type Store interface { //ReadDir returns the entries of a folder content ReadDir(name string, filter Filter) ([]fs.FileInfo, error) // Read reads data from a file into a writer Read(name string, rang *Range, dest io.Writer, progress chan int64) error // Write writes data to a file name. An existing file is overwritten Write(name string, source io.ReadSeeker, progress chan int64) error // Stat provides statistics about a file Stat(name string) (os.FileInfo, error) // Delete deletes a file Delete(name string) error //Url returns the connection url Url() string // Close releases resources Close() error // String returns a human-readable representation of the storer (e.g. sftp://user@host.cc/path) String() string Describe() Description }
Store is a low level interface to storage services such as S3 or SFTP
func NewTestStore ¶
func OpenMemory ¶
func OpenWebDAV ¶
Click to show internal directories.
Click to hide internal directories.