Documentation
¶
Overview ¶
Package confcrypt provides a simple interface for encrypting and decrypting your config.
Index ¶
- Variables
- func Decode(obj interface{}, key string) (interface{}, error)
- func DecodeByEnv(v interface{}, opts ...DecodeOption) error
- func DecodeInplace(v interface{}, key string) error
- func Decrypt(text string, passphrase string) ([]byte, error)
- func Encrypt(data []byte, passphrase string) (string, error)
- func EncryptString(s string, key string) (string, error)
- type DecodeOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCipherText = errors.New("invalid text to decrypt")
)
Functions ¶
func Decode ¶
Decode decrypts the encrypted string fields start with `ENC~` in fields tree of obj and returns the decrypted obj.
func DecodeByEnv ¶ added in v0.2.0
func DecodeByEnv(v interface{}, opts ...DecodeOption) error
func DecodeInplace ¶ added in v0.2.0
Types ¶
type DecodeOption ¶ added in v0.2.0
type DecodeOption func(*decodeOption)
func WithEnv ¶ added in v0.2.0
func WithEnv(env string) DecodeOption
Click to show internal directories.
Click to hide internal directories.