Documentation ¶
Index ¶
- Constants
- Variables
- type Checksum
- type File
- func (f *File) Chmod(mode os.FileMode) error
- func (f *File) Chown(uid, gid int) error
- func (f *File) Close() error
- func (f *File) Name() string
- func (f *File) Read(b []byte) (int, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) String() string
- func (f *File) Write(b []byte) (int, error)
- type Mode
- type Reader
- type Secret
- func (s *Secret) Add(data string) *Secret
- func (s *Secret) AddBase64(data string) *Secret
- func (s *Secret) AddEnv(name string) *Secret
- func (s *Secret) AddFile(file string) *Secret
- func (s *Secret) AddHex(data string) *Secret
- func (s *Secret) Checksum() Checksum
- func (s *Secret) Decrypt(data []byte) ([]byte, error)
- func (s *Secret) DecryptFromBase64(data []byte) ([]byte, error)
- func (s *Secret) Encrypt(data []byte) ([]byte, error)
- func (s *Secret) EncryptToBase64(data []byte) ([]byte, error)
- func (s *Secret) NewReader(r io.Reader, mode Mode) (*Reader, error)
- func (s *Secret) NewWriter(w io.WriteCloser) (*Writer, error)
- func (s *Secret) Open(name string) (*File, error)
- func (s *Secret) OpenFile(name string, flag int, perm os.FileMode) (*File, error)
- func (s *Secret) ReadFile(name string) ([]byte, error)
- func (s *Secret) String() string
- func (s *Secret) Validate() error
- func (s *Secret) WriteFile(name string, data []byte, perm os.FileMode) error
- type Writer
Constants ¶
const SALT_SIZE = 32
SALT_SIZE is default salt size
Variables ¶
var ( ErrNilFile = fmt.Errorf("File is nil") ErrNilSecret = fmt.Errorf("Secret is nil") ErrEmptySecret = fmt.Errorf("Secret is empty") ErrEmptySecretData = fmt.Errorf("Secret data is empty") ErrEmptySecretPath = fmt.Errorf("Secret path is empty") ErrEmptyEnvVarName = fmt.Errorf("Environment variable name is empty") ErrEmptyEnvVar = fmt.Errorf("Environment variable is empty") )
Functions ¶
This section is empty.
Types ¶
type Checksum ¶ added in v0.0.4
type Checksum []byte
Checksum is secret checksum
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents encrypted file
type Reader ¶ added in v0.1.0
type Reader struct {
// contains filtered or unexported fields
}
Reader is encrypted data reader
type Secret ¶ added in v0.0.2
type Secret struct {
// contains filtered or unexported fields
}
Secret is katana secret storage
func (*Secret) AddEnv ¶ added in v0.0.2
AddEnv adds dynamic part of the key for environment variable
func (*Secret) AddFile ¶ added in v0.0.2
AddFile adds dynamic part of the key based on SHA-512 hash of the file
func (*Secret) DecryptFromBase64 ¶ added in v0.4.0
DecryptFromBase64 decrypts Base64-encoded data
func (*Secret) EncryptToBase64 ¶ added in v0.4.0
EncryptToBase64 encrypts given data and encodes result to Base64
func (*Secret) NewWriter ¶ added in v0.1.0
func (s *Secret) NewWriter(w io.WriteCloser) (*Writer, error)
NewWriter creates new writer instance
func (*Secret) Open ¶ added in v0.0.2
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.
func (*Secret) OpenFile ¶ added in v0.0.2
OpenFile opens the named file with specified flag (O_RDONLY etc.). If the file does not exist, and the O_CREATE flag is passed, it is created with mode perm (before umask).