Documentation ¶
Index ¶
- type EncryptedStorage
- func (storage EncryptedStorage) AppendFile(path string, data []byte) error
- func (storage EncryptedStorage) Chmod(path string, mod os.FileMode) error
- func (storage EncryptedStorage) CountFiles(path string) (int, error)
- func (storage EncryptedStorage) Delete(path string) error
- func (storage EncryptedStorage) Exists(path string) (bool, error)
- func (storage EncryptedStorage) LastModification(path string) (time.Time, error)
- func (storage EncryptedStorage) ListDirectory(path string, ascending bool) ([]string, error)
- func (storage EncryptedStorage) Mkdir(path string) error
- func (storage EncryptedStorage) ReadFileFully(path string) ([]byte, error)
- func (storage EncryptedStorage) TouchFile(path string) error
- func (storage EncryptedStorage) WriteFile(path string, data []byte) error
- func (storage EncryptedStorage) WriteFileExclusive(path string, data []byte) error
- type NilStorage
- func (storage NilStorage) AppendFile(path string, data []byte) error
- func (storage NilStorage) Chmod(path string, mod os.FileMode) error
- func (storage NilStorage) CountFiles(path string) (int, error)
- func (storage NilStorage) DeleteFile(path string) error
- func (storage NilStorage) Exists(path string) (bool, error)
- func (storage NilStorage) LastModification(path string) (time.Time, error)
- func (storage NilStorage) ListDirectory(path string, ascending bool) ([]string, error)
- func (storage NilStorage) ReadFileFully(path string) ([]byte, error)
- func (storage NilStorage) TouchFile(path string) error
- func (storage NilStorage) WriteFile(path string, data []byte) error
- func (storage NilStorage) WriteFileExclusive(path string, data []byte) error
- type PlaintextStorage
- func (storage PlaintextStorage) AppendFile(path string, data []byte) error
- func (storage PlaintextStorage) Chmod(path string, mod os.FileMode) error
- func (storage PlaintextStorage) CountFiles(path string) (int, error)
- func (storage PlaintextStorage) Delete(path string) error
- func (storage PlaintextStorage) Exists(path string) (bool, error)
- func (storage PlaintextStorage) LastModification(path string) (time.Time, error)
- func (storage PlaintextStorage) ListDirectory(path string, ascending bool) ([]string, error)
- func (storage PlaintextStorage) Mkdir(path string) error
- func (storage PlaintextStorage) ReadFileFully(path string) ([]byte, error)
- func (storage PlaintextStorage) TouchFile(path string) error
- func (storage PlaintextStorage) WriteFile(path string, data []byte) error
- func (storage PlaintextStorage) WriteFileExclusive(path string, data []byte) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedStorage ¶ added in v1.1.0
type EncryptedStorage struct { Storage // contains filtered or unexported fields }
EncryptedStorage is a fascade to access encrypted storage
func (EncryptedStorage) AppendFile ¶ added in v1.1.0
func (storage EncryptedStorage) AppendFile(path string, data []byte) error
AppendFile appens data given absolute path to a file, creates it if it does not exist
func (EncryptedStorage) Chmod ¶ added in v1.1.8
func (storage EncryptedStorage) Chmod(path string, mod os.FileMode) error
Chmod sets chmod flag on given file
func (EncryptedStorage) CountFiles ¶ added in v1.1.0
func (storage EncryptedStorage) CountFiles(path string) (int, error)
CountFiles returns number of items in directory
func (EncryptedStorage) Delete ¶ added in v1.2.5
func (storage EncryptedStorage) Delete(path string) error
Delete removes given absolute path if that file does exists
func (EncryptedStorage) Exists ¶ added in v1.1.0
func (storage EncryptedStorage) Exists(path string) (bool, error)
Exists returns true if path exists
func (EncryptedStorage) LastModification ¶ added in v1.1.4
func (storage EncryptedStorage) LastModification(path string) (time.Time, error)
LastModification returns time of last modification
func (EncryptedStorage) ListDirectory ¶ added in v1.1.0
func (storage EncryptedStorage) ListDirectory(path string, ascending bool) ([]string, error)
ListDirectory returns sorted slice of item names in given absolute path default sorting is ascending
func (EncryptedStorage) Mkdir ¶ added in v1.2.7
func (storage EncryptedStorage) Mkdir(path string) error
Mkdir creates directory given absolute path
func (EncryptedStorage) ReadFileFully ¶ added in v1.1.0
func (storage EncryptedStorage) ReadFileFully(path string) ([]byte, error)
ReadFileFully reads whole file given path
func (EncryptedStorage) TouchFile ¶ added in v1.1.0
func (storage EncryptedStorage) TouchFile(path string) error
TouchFile creates file given absolute path if file does not already exist
func (EncryptedStorage) WriteFile ¶ added in v1.1.0
func (storage EncryptedStorage) WriteFile(path string, data []byte) error
WriteFile writes data given absolute path to a file, creates it if it does not exist
func (EncryptedStorage) WriteFileExclusive ¶ added in v1.1.0
func (storage EncryptedStorage) WriteFileExclusive(path string, data []byte) error
WriteFileExclusive writes data given path to a file if that file does not already exists
type NilStorage ¶ added in v1.1.7
type NilStorage struct {
Storage
}
NilStorage is a nil storage fascade
func (NilStorage) AppendFile ¶ added in v1.1.7
func (storage NilStorage) AppendFile(path string, data []byte) error
AppendFile stub
func (NilStorage) Chmod ¶ added in v1.1.8
func (storage NilStorage) Chmod(path string, mod os.FileMode) error
Chmod sbut
func (NilStorage) CountFiles ¶ added in v1.1.7
func (storage NilStorage) CountFiles(path string) (int, error)
CountFiles stub
func (NilStorage) DeleteFile ¶ added in v1.1.7
func (storage NilStorage) DeleteFile(path string) error
DeleteFile stub
func (NilStorage) Exists ¶ added in v1.1.7
func (storage NilStorage) Exists(path string) (bool, error)
Exists stub
func (NilStorage) LastModification ¶ added in v1.1.7
func (storage NilStorage) LastModification(path string) (time.Time, error)
LastModification stub
func (NilStorage) ListDirectory ¶ added in v1.1.7
func (storage NilStorage) ListDirectory(path string, ascending bool) ([]string, error)
ListDirectory stub
func (NilStorage) ReadFileFully ¶ added in v1.1.7
func (storage NilStorage) ReadFileFully(path string) ([]byte, error)
ReadFileFully stub
func (NilStorage) TouchFile ¶ added in v1.1.7
func (storage NilStorage) TouchFile(path string) error
TouchFile stub
func (NilStorage) WriteFile ¶ added in v1.1.7
func (storage NilStorage) WriteFile(path string, data []byte) error
WriteFile stub
func (NilStorage) WriteFileExclusive ¶ added in v1.1.7
func (storage NilStorage) WriteFileExclusive(path string, data []byte) error
WriteFileExclusive stub
type PlaintextStorage ¶ added in v1.1.0
type PlaintextStorage struct { Storage // contains filtered or unexported fields }
PlaintextStorage is a fascade to access plaintext storage
func (PlaintextStorage) AppendFile ¶ added in v1.1.0
func (storage PlaintextStorage) AppendFile(path string, data []byte) error
AppendFile appens data given absolute path to a file, creates it if it does not exist
func (PlaintextStorage) Chmod ¶ added in v1.1.8
func (storage PlaintextStorage) Chmod(path string, mod os.FileMode) error
Chmod sets chmod flag on given file
func (PlaintextStorage) CountFiles ¶ added in v1.1.0
func (storage PlaintextStorage) CountFiles(path string) (int, error)
CountFiles returns number of items in directory
func (PlaintextStorage) Delete ¶ added in v1.2.6
func (storage PlaintextStorage) Delete(path string) error
Delete removes given absolute path if that file does exists
func (PlaintextStorage) Exists ¶ added in v1.1.0
func (storage PlaintextStorage) Exists(path string) (bool, error)
Exists returns true if path exists
func (PlaintextStorage) LastModification ¶ added in v1.1.4
func (storage PlaintextStorage) LastModification(path string) (time.Time, error)
LastModification returns time of last modification
func (PlaintextStorage) ListDirectory ¶ added in v1.1.0
func (storage PlaintextStorage) ListDirectory(path string, ascending bool) ([]string, error)
ListDirectory returns sorted slice of item names in given absolute path default sorting is ascending
func (PlaintextStorage) Mkdir ¶ added in v1.2.7
func (storage PlaintextStorage) Mkdir(path string) error
Mkdir creates directory given absolute path
func (PlaintextStorage) ReadFileFully ¶ added in v1.1.0
func (storage PlaintextStorage) ReadFileFully(path string) ([]byte, error)
ReadFileFully reads whole file given path
func (PlaintextStorage) TouchFile ¶ added in v1.1.0
func (storage PlaintextStorage) TouchFile(path string) error
TouchFile creates files given absolute path if file does not already exist
func (PlaintextStorage) WriteFile ¶ added in v1.1.0
func (storage PlaintextStorage) WriteFile(path string, data []byte) error
WriteFile writes data given absolute path to a file, creates it if it does not exist
func (PlaintextStorage) WriteFileExclusive ¶ added in v1.1.0
func (storage PlaintextStorage) WriteFileExclusive(path string, data []byte) error
WriteFileExclusive writes data given path to a file if that file does not already exists
type Storage ¶
type Storage interface { Chmod(absPath string, mod os.FileMode) error ListDirectory(string, bool) ([]string, error) CountFiles(string) (int, error) Exists(string) (bool, error) TouchFile(string) error Mkdir(string) error ReadFileFully(string) ([]byte, error) WriteFileExclusive(string, []byte) error WriteFile(string, []byte) error Delete(string) error AppendFile(string, []byte) error LastModification(string) (time.Time, error) }
Storage represents contract
func NewEncryptedStorage ¶ added in v1.1.0
NewEncryptedStorage returns new storage over given root
func NewPlaintextStorage ¶ added in v1.1.0
NewPlaintextStorage returns new storage over given root