Documentation ¶
Overview ¶
Package fs provides an fs.FS implementation for encrypted Charm Cloud storage.
Index ¶
- type DirFile
- type FS
- func (cfs *FS) Client() *client.Client
- func (cfs *FS) DecryptPath(path string) (string, error)
- func (cfs *FS) EncryptPath(path string) (string, error)
- func (cfs *FS) Open(name string) (fs.File, error)
- func (cfs *FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (cfs *FS) ReadFile(name string) ([]byte, error)
- func (cfs *FS) Remove(name string) error
- func (cfs *FS) WriteFile(name string, src fs.File) error
- type File
- type FileInfo
- func (fi *FileInfo) Info() (fs.FileInfo, error)
- func (fi *FileInfo) IsDir() bool
- func (fi *FileInfo) ModTime() time.Time
- func (fi *FileInfo) Mode() fs.FileMode
- func (fi *FileInfo) Name() string
- func (fi *FileInfo) Size() int64
- func (fi *FileInfo) Sys() interface{}
- func (fi *FileInfo) Type() fs.FileMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirFile ¶
DirFile is a fs.File that represents a directory entry.
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is an implementation of fs.FS, fs.ReadFileFS and fs.ReadDirFS with additional write methods. Data is stored across the network on a Charm Cloud server, with encryption and decryption happening client-side.
func NewFSWithClient ¶
NewFSWithClient returns an FS with a custom *client.Client.
func (*FS) DecryptPath ¶
DecryptPath returns the unencrypted path for a given path.
func (*FS) EncryptPath ¶
EncryptPath returns the encrypted path for a given path.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File implements the fs.File interface.
func (*File) Read ¶
Read reads bytes from the file returning number of bytes read or an error. The error io.EOF will be returned when there is nothing else to read.
type FileInfo ¶
FileInfo implements the fs.FileInfo interface.