Documentation
¶
Index ¶
- Variables
- type Buffer
- type DB
- func (db *DB) Delete(key string) error
- func (db *DB) Get(key string) ([]byte, error)
- func (db *DB) GetBuffer(key string) (Buffer, error)
- func (db *DB) GetBufferSlice(key string) ([]Buffer, error)
- func (db *DB) GetSecure(key string) ([]byte, error)
- func (db *DB) GetSecureBuffer(key string) (Buffer, error)
- func (db *DB) GetSecureBufferSlice(key string) ([]Buffer, error)
- func (db *DB) InitAES128(secret string) error
- func (db *DB) InitAES256(secret string) error
- func (db *DB) IsExist(key string) bool
- func (db *DB) KeyPath(key string) string
- func (db *DB) Set(key string, value []byte) error
- func (db *DB) SetBuffer(key string, value Buffer) error
- func (db *DB) SetBufferSlice(key string, value []Buffer) error
- func (db *DB) SetSecure(key string, value []byte) error
- func (db *DB) SetSecureBuffer(key string, value Buffer) error
- func (db *DB) SetSecureBufferSlice(key string, value []Buffer) error
- func (db *DB) String() string
- type FileEngine
- func (eng *FileEngine) Cancel()
- func (eng *FileEngine) FileExist(fpath string) bool
- func (eng *FileEngine) PurgeFile(fpath string) error
- func (eng *FileEngine) ReadFile(fpath string) ([]byte, error)
- func (eng *FileEngine) UpdateOptions(opts Options)
- func (eng *FileEngine) WriteFile(fpath string, data []byte) error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrError = errors.New("") ErrTimeout = fmt.Errorf("%wtimeout", ErrError) ErrBreak = fmt.Errorf("%woperation break", ErrError) ErrRead = fmt.Errorf("%wread failed", ErrError) ErrWrite = fmt.Errorf("%wwrite failed", ErrError) ErrNotExist = fmt.Errorf("%wfile does not exist", ErrError) ErrLocked = fmt.Errorf("%wfile locked", ErrError) ErrNoSecurity = fmt.Errorf("%wsecurity not configured", ErrError) ErrInvalidKey = fmt.Errorf("%winvalid key size", ErrError) ErrEncrypt = fmt.Errorf("%wencryption failed", ErrError) ErrDecrypt = fmt.Errorf("%wdecryption failed", ErrError) )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { *FileEngine // root file path prefix for all operations RootPath string // contains filtered or unexported fields }
func (*DB) InitAES128 ¶
func (*DB) InitAES256 ¶
func (*DB) SetSecureBufferSlice ¶
type FileEngine ¶
type FileEngine struct { // timeout for operations like read/write OpTimeout float64 // polling interval for blocked operations OpPolling float64 // permission for new dir creation DirPerm uint32 // permission for new file creation FilePerm uint32 // contains filtered or unexported fields }
func (*FileEngine) FileExist ¶
func (eng *FileEngine) FileExist(fpath string) bool
check if file exists and is regular file
func (*FileEngine) ReadFile ¶
func (eng *FileEngine) ReadFile(fpath string) ([]byte, error)
read file content with shared locking
func (*FileEngine) UpdateOptions ¶
func (eng *FileEngine) UpdateOptions(opts Options)
update file engine options
Click to show internal directories.
Click to hide internal directories.