Documentation ¶
Index ¶
- Constants
- Variables
- func AesCbcDecrypt(key, iv []byte, ciphertext []byte) ([]byte, error)
- func AesCbcEncrypt(key, iv []byte, plaintext []byte) ([]byte, error)
- func AesCtrDecrypt(key, iv []byte, ciphertext []byte) ([]byte, error)
- func AesCtrEncrypt(key, iv []byte, plaintext []byte) ([]byte, error)
- func AesEcbDecrypt(key []byte, ciphertext []byte) ([]byte, error)
- func AesEcbEncrypt(key []byte, plaintext []byte) ([]byte, error)
- func AesGcmDecrypt(key, nonce []byte, ciphertext []byte) ([]byte, error)
- func AesGcmEncrypt(key, nonce []byte, plaintext []byte) ([]byte, error)
- func Base64DecodeString(s string) ([]byte, error)
- func Base64EncodeToString(src []byte) string
- func DecryptFileContent(masterKey, iv, encryptFileContent []byte) ([]byte, error)
- func DecryptFileKey(masterKey, encryptFileKey []byte) ([]byte, error)
- func DecryptFileName(masterKey, encryptFileName []byte) ([]byte, error)
- func DecryptMasterKey(encryptKey, encryptMasterKey []byte) ([]byte, error)
- func EncryptFileContent(masterKey, iv, content []byte) ([]byte, error)
- func EncryptFileKey(masterKey, fileKey []byte) ([]byte, error)
- func EncryptFileName(masterKey, fileName []byte) ([]byte, error)
- func EncryptMasterKey(encryptKey, masterKey []byte) ([]byte, error)
- func GenEncryptKeyAndAuthKeyFromPassword(password string, salt []byte) (encryptKey, authKey []byte)
- func HashAuthKey(authKey []byte) []byte
- func InitBolt(path string) error
- func IsPasswordTooWeak(password string) bool
- func MustAesCbcDecrypt(key, iv []byte, ciphertext []byte) []byte
- func MustAesCbcEncrypt(key, iv []byte, plaintext []byte) []byte
- func MustDecryptFileName(masterKey, encryptFileName []byte) []byte
- func MustDecryptMasterKey(encryptKey, encryptMasterKey []byte) []byte
- func MustEncryptFileName(masterKey, fileName []byte) []byte
- func MustEncryptMasterKey(encryptKey, masterKey []byte) []byte
- func MustRandomMasterKey() []byte
- func MustRandomSalt() []byte
- func NewFileInfo(masterKey []byte, fi os.FileInfo) os.FileInfo
- func NewFileSystem(client *gowebdav.Client, masterKey []byte) webdav.FileSystem
- func Pkcs5Padding(b []byte) []byte
- func Pkcs5UnPadding(b []byte) []byte
- func RandomFileKey() ([]byte, error)
- func ReadBolt() (salt, encryptMasterKey, authKey []byte, err error)
- func ReadPassword(promt string) (string, error)
- func Sha256(in []byte) []byte
- func ShowVersion()
- func WriteBolt(salt, encryptMasterKey, authKey []byte) error
- type Config
- type FileInfo
- type FileSystem
- func (fs *FileSystem) Mkdir(ctx context.Context, name string, perm os.FileMode) (err error)
- func (fs *FileSystem) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (result webdav.File, err error)
- func (fs *FileSystem) ReadDir(ctx context.Context, name string) (fis []fs.FileInfo, err error)
- func (fs *FileSystem) RemoveAll(ctx context.Context, name string) (err error)
- func (fs *FileSystem) Rename(ctx context.Context, oldName, newName string) (err error)
- func (fs *FileSystem) Stat(ctx context.Context, name string) (fi os.FileInfo, err error)
- type Logger
- type ReadableFile
- func (file *ReadableFile) Close() error
- func (file *ReadableFile) Read(p []byte) (n int, err error)
- func (file *ReadableFile) Readdir(count int) (fis []fs.FileInfo, err error)
- func (file *ReadableFile) Seek(offset int64, whence int) (n int64, err error)
- func (file *ReadableFile) Stat() (fi fs.FileInfo, err error)
- func (file *ReadableFile) Write(p []byte) (n int, err error)
- type UpstreamConfig
- type UpstreamWebdavConfig
- type WebdavConfig
- type WritableFile
- func (file *WritableFile) Close() (err error)
- func (file *WritableFile) IsDir() bool
- func (file *WritableFile) ModTime() time.Time
- func (file *WritableFile) Mode() fs.FileMode
- func (file *WritableFile) Name() string
- func (file *WritableFile) Read(p []byte) (n int, err error)
- func (file *WritableFile) Readdir(count int) ([]fs.FileInfo, error)
- func (file *WritableFile) Seek(offset int64, whence int) (int64, error)
- func (file *WritableFile) Size() int64
- func (file *WritableFile) Stat() (fs.FileInfo, error)
- func (file *WritableFile) Sys() any
- func (file *WritableFile) Write(p []byte) (n int, err error)
Constants ¶
View Source
const FILE_MODE fs.FileMode = 0600
Variables ¶
View Source
var Name string = "span"
View Source
var Version string = "unkown"
Functions ¶
func Base64DecodeString ¶
func Base64EncodeToString ¶
func DecryptFileContent ¶
func DecryptFileKey ¶
func DecryptFileName ¶
func EncryptFileContent ¶
func EncryptFileKey ¶
func EncryptFileName ¶
func MustAesCbcDecrypt ¶
func MustAesCbcEncrypt ¶
func MustDecryptFileName ¶
func MustDecryptMasterKey ¶
func MustEncryptFileName ¶
func MustEncryptMasterKey ¶
func MustRandomMasterKey ¶
func MustRandomMasterKey() []byte
func MustRandomSalt ¶
func MustRandomSalt() []byte
func NewFileSystem ¶
func NewFileSystem(client *gowebdav.Client, masterKey []byte) webdav.FileSystem
func Pkcs5Padding ¶
func Pkcs5UnPadding ¶
func RandomFileKey ¶
func ReadPassword ¶
func ShowVersion ¶
func ShowVersion()
Types ¶
type Config ¶
type Config struct { Logger Logger `json:"logger" yaml:"logger"` Password string `json:"password" yaml:"password"` Webdav WebdavConfig `json:"webdav" yaml:"webdav"` Upstream UpstreamConfig `json:"upstream" yaml:"upstream"` }
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func (*FileSystem) RemoveAll ¶
func (fs *FileSystem) RemoveAll(ctx context.Context, name string) (err error)
type Logger ¶
type Logger struct { Format logger.LogFormat `json:"format" yaml:"format"` Level string `json:"level" yaml:"level"` }
type ReadableFile ¶
type ReadableFile struct {
// contains filtered or unexported fields
}
func NewReadableFile ¶
func NewReadableFile(fs *FileSystem, masterKey []byte, path string) *ReadableFile
func (*ReadableFile) Close ¶
func (file *ReadableFile) Close() error
func (*ReadableFile) Readdir ¶
func (file *ReadableFile) Readdir(count int) (fis []fs.FileInfo, err error)
type UpstreamConfig ¶
type UpstreamConfig struct {
Webdav UpstreamWebdavConfig `json:"webdav" yaml:"webdav"`
}
type UpstreamWebdavConfig ¶
type WebdavConfig ¶
type WritableFile ¶
type WritableFile struct {
// contains filtered or unexported fields
}
func NewWritableFile ¶
func NewWritableFile(fs *FileSystem, masterKey []byte, path string) *WritableFile
func (*WritableFile) Close ¶
func (file *WritableFile) Close() (err error)
func (*WritableFile) IsDir ¶
func (file *WritableFile) IsDir() bool
func (*WritableFile) ModTime ¶
func (file *WritableFile) ModTime() time.Time
func (*WritableFile) Mode ¶
func (file *WritableFile) Mode() fs.FileMode
func (*WritableFile) Name ¶
func (file *WritableFile) Name() string
func (*WritableFile) Size ¶
func (file *WritableFile) Size() int64
func (*WritableFile) Sys ¶
func (file *WritableFile) Sys() any
Click to show internal directories.
Click to hide internal directories.