Documentation
¶
Index ¶
- type AESCryptor
- type Coder
- type Compressor
- type Cryptor
- func NewGPGCryptor(publicKey, privateKey io.Reader, password []byte) (Cryptor, error)
- func NewGPGCryptorFile(publicKeyPath, privateKeyPath string, password []byte) (Cryptor, error)
- func NewGPGDecryptor(data io.Reader, password []byte) (Cryptor, error)
- func NewGPGDecryptorFile(path string, password []byte) (Cryptor, error)
- func NewGPGEncryptor(data io.Reader) (Cryptor, error)
- func NewGPGEncryptorFile(path string) (Cryptor, error)
- type FS
- func (fsys *FS) Disfigure(plaintext []byte) ([]byte, error)
- func (fsys *FS) Open(name string) (fs.File, error)
- func (fsys *FS) ReadFile(name string) ([]byte, error)
- func (fsys *FS) Reveal(encodedBytes []byte) ([]byte, error)
- func (fsys *FS) SetCoder(coder Coder)
- func (fsys *FS) SetCompression(compressor Compressor)
- func (fsys *FS) WriteFile(filepath string, plaintext []byte, perm fs.FileMode) error
- type GPGCryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AESCryptor ¶
type AESCryptor struct {
// contains filtered or unexported fields
}
func NewAESCryptor ¶
func NewAESCryptor(key []byte) (*AESCryptor, error)
NewAESCryptor returns an Cryptor which performs AES encryption/decryption.
The key must be 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
type Coder ¶
type Coder interface {
// contains filtered or unexported methods
}
Coder is an interface describing two operations which transform data into another format. This can be done to compress or disfigure bytes.
func Base64 ¶
func Base64() Coder
Base64 is a Coder which transforms data following RFC 4648 section 3.2. There are no padding characters added or accepted by this Coder.
type Compressor ¶ added in v0.5.0
type Compressor interface {
// contains filtered or unexported methods
}
func Gzip ¶ added in v0.5.0
func Gzip() Compressor
func GzipLevel ¶ added in v0.5.0
func GzipLevel(level int) Compressor
GzipLevel allows callers to specify the compression level. Refer to compress/gzip.DefaultCompression and other values for more details.
func GzipRequired ¶ added in v0.5.0
func GzipRequired(level int) Compressor
GzipRequired forces the Compressor to only allow gzipped data to be decompressed.
Refer to compress/gzip.DefaultCompression and other values for more details on levels.
func NoCompression ¶ added in v0.5.0
func NoCompression() Compressor
type Cryptor ¶
type Cryptor interface {
// contains filtered or unexported methods
}
func NewGPGCryptor ¶ added in v0.4.0
func NewGPGCryptorFile ¶ added in v0.4.0
func NewGPGDecryptor ¶ added in v0.4.0
func NewGPGDecryptorFile ¶ added in v0.4.0
func NewGPGEncryptorFile ¶ added in v0.4.0
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func FromCryptor ¶
FromCryptor returns an FS instance and allows passing the results of creating a Cryptor directly as the arguments.
func (*FS) SetCompression ¶ added in v0.5.0
func (fsys *FS) SetCompression(compressor Compressor)
type GPGCryptor ¶ added in v0.4.0
type GPGCryptor struct {
// contains filtered or unexported fields
}