Documentation ¶
Overview ¶
Package k2hash implements a k2hash library.
Index ¶
- type Attr
- type GetResult
- type K2hash
- func (k2h *K2hash) AddAttr(k interface{}, ak interface{}, av interface{}, options ...func(*Params)) (bool, error)
- func (k2h *K2hash) AddAttrPluginLibrary(file string) (bool, error)
- func (k2h *K2hash) AddDecryptionPassword(pass string) (bool, error)
- func (k2h *K2hash) AddSubKey(k interface{}, s interface{}, v interface{}, options ...func(*Params)) (bool, error)
- func (k2h *K2hash) BeginTx(file string, options ...func(*TxParams)) (bool, error)
- func (k2h *K2hash) BumpDebugLevel()
- func (k2h *K2hash) Close() (bool, error)
- func (k2h *K2hash) Create() bool
- func (k2h *K2hash) DumpElementTable() bool
- func (k2h *K2hash) DumpFull() bool
- func (k2h *K2hash) DumpFullKeyTable() bool
- func (k2h *K2hash) DumpHead() bool
- func (k2h *K2hash) DumpKeyTable() bool
- func (k2h *K2hash) DumpToFile(file string, ignoreError bool) (bool, error)
- func (k2h *K2hash) EnableEncryption(enable bool, file string) (bool, error)
- func (k2h *K2hash) EnableHistory(enable bool) (bool, error)
- func (k2h *K2hash) EnableMtime(enable bool) (bool, error)
- func (k2h *K2hash) Get(k interface{}, options ...func(*Params)) (*GetResult, error)
- func (k2h *K2hash) GetAttrs(k string) ([]Attr, error)
- func (k2h *K2hash) GetHandle() C.k2h_h
- func (k2h *K2hash) GetSubKeys(k string) ([]string, error)
- func (k2h *K2hash) GetTxFileFD() int32
- func (k2h *K2hash) GetTxThreadPoolSize() (int32, error)
- func (k2h *K2hash) LoadDebugEnv() bool
- func (k2h *K2hash) LoadFromFile(file string, ignoreError bool) (bool, error)
- func (k2h *K2hash) LoadHashLibrary(filepath string) bool
- func (k2h *K2hash) LoadTxLibrary(filepath string) bool
- func (k2h *K2hash) Open() (bool, error)
- func (k2h *K2hash) PrintAttrInformation()
- func (k2h *K2hash) PrintAttrVersion()
- func (k2h *K2hash) PrintState() bool
- func (k2h *K2hash) PrintVersion()
- func (k2h *K2hash) Remove(k interface{}, options ...func(*RemoveParams)) (bool, error)
- func (k2h *K2hash) Rename(o interface{}, n interface{}) (bool, error)
- func (k2h *K2hash) Set(k interface{}, v interface{}, options ...func(*Params)) (bool, error)
- func (k2h *K2hash) SetDebugFile(filepath string) bool
- func (k2h *K2hash) SetDebugLevelError()
- func (k2h *K2hash) SetDebugLevelMessage()
- func (k2h *K2hash) SetDebugLevelSilent()
- func (k2h *K2hash) SetDebugLevelWarning()
- func (k2h *K2hash) SetDefaultEncryptionPassword(pass string) (bool, error)
- func (k2h *K2hash) SetExpirationDuration(duration int) (bool, error)
- func (k2h *K2hash) SetSignalUser1() bool
- func (k2h *K2hash) SetSubKeys(k interface{}, sk interface{}) (bool, error)
- func (k2h *K2hash) SetTxThreadPoolSize(pool int32) (bool, error)
- func (k2h *K2hash) StopTx() (bool, error)
- func (k2h *K2hash) String() string
- func (k2h *K2hash) UnloadHashLibrary() bool
- func (k2h *K2hash) UnloadTxLibrary() bool
- func (k2h *K2hash) UnsetDebugFile() bool
- func (k2h *K2hash) UnsetTxThreadPoolSize() (bool, error)
- type KeyQueue
- type Params
- type Queue
- type QueueParams
- type RemoveParams
- type TxParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attr ¶
type Attr struct {
// contains filtered or unexported fields
}
Attr holds attribute names and values.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult holds the result of Get.
type K2hash ¶
type K2hash struct {
// contains filtered or unexported fields
}
K2hash keeps configurations, and it is responsible for creating request handles with a k2hash database files and closing them.
func (*K2hash) AddAttr ¶
func (k2h *K2hash) AddAttr(k interface{}, ak interface{}, av interface{}, options ...func(*Params)) (bool, error)
AddAttr adds an attribute with a value to a key.
func (*K2hash) AddAttrPluginLibrary ¶
AddAttrPluginLibrary loads a shared library for processing attribute data.
func (*K2hash) AddDecryptionPassword ¶
AddDecryptionPassword sets the decryption passphrase.
func (*K2hash) AddSubKey ¶
func (k2h *K2hash) AddSubKey(k interface{}, s interface{}, v interface{}, options ...func(*Params)) (bool, error)
AddSubKey add a subkey to a key.
func (*K2hash) BumpDebugLevel ¶
func (k2h *K2hash) BumpDebugLevel()
BumpDebugLevel changes the log level.
func (*K2hash) Create ¶
Create creates a k2hash file. It returns a error if the file already exists.
func (*K2hash) DumpElementTable ¶
DumpElementTable dumps K2HASH's Element table information to a file referred by FILE pointer.
func (*K2hash) DumpFullKeyTable ¶
DumpFullKeyTable dumps K2HASH's hash key and subkey information to a file referred by FILE pointer.
func (*K2hash) DumpHead ¶
DumpHead dumps K2HASH header information to a file referred by FILE pointer.
func (*K2hash) DumpKeyTable ¶
DumpKeyTable dumps K2HASH's hash key table information to a file referred by FILE pointer.
func (*K2hash) DumpToFile ¶
DumpToFile saves data from a file as a serialized data.
func (*K2hash) EnableEncryption ¶
EnableEncryption enables the k2hash file attributes of data encryption.
func (*K2hash) EnableHistory ¶
EnableHistory enables the k2hash file attributes of history.
func (*K2hash) EnableMtime ¶
EnableMtime enables the k2hash file attributes of modification time.
func (*K2hash) GetSubKeys ¶
GetSubKeys returns subkeys to a key.
func (*K2hash) GetTxFileFD ¶
GetTxFileFD returns the file descriptor for transaction file.
func (*K2hash) GetTxThreadPoolSize ¶
GetTxThreadPoolSize returns the number of thread pools.
func (*K2hash) LoadDebugEnv ¶
LoadDebugEnv defines the log level and the file by using K2HDBGMODE, K2HDBGFILE.
func (*K2hash) LoadFromFile ¶
LoadFromFile loads data from archive files.
func (*K2hash) LoadHashLibrary ¶
LoadHashLibrary loads the hash library.
func (*K2hash) LoadTxLibrary ¶
LoadTxLibrary loads the hash library.
func (*K2hash) PrintAttrInformation ¶
func (k2h *K2hash) PrintAttrInformation()
PrintAttrInformation prints attributes to stderr.
func (*K2hash) PrintAttrVersion ¶
func (k2h *K2hash) PrintAttrVersion()
PrintAttrVersion prints attribute plugins to stderr.
func (*K2hash) PrintState ¶
PrintState prints k2hash file stats.
func (*K2hash) PrintVersion ¶
func (k2h *K2hash) PrintVersion()
PrintVersion prints the k2hash library version and the credit.
func (*K2hash) Remove ¶
func (k2h *K2hash) Remove(k interface{}, options ...func(*RemoveParams)) (bool, error)
Remove removes a key or a subkey.
func (*K2hash) SetDebugFile ¶
SetDebugFile defines the file where log messages are saved.
func (*K2hash) SetDebugLevelError ¶
func (k2h *K2hash) SetDebugLevelError()
SetDebugLevelError logs error level messages.
func (*K2hash) SetDebugLevelMessage ¶
func (k2h *K2hash) SetDebugLevelMessage()
SetDebugLevelMessage logs info or higher level messages.
func (*K2hash) SetDebugLevelSilent ¶
func (k2h *K2hash) SetDebugLevelSilent()
SetDebugLevelSilent disables logging.
func (*K2hash) SetDebugLevelWarning ¶
func (k2h *K2hash) SetDebugLevelWarning()
SetDebugLevelWarning logs warning or higher level messages.
func (*K2hash) SetDefaultEncryptionPassword ¶
SetDefaultEncryptionPassword sets the encryption passphrase.
func (*K2hash) SetExpirationDuration ¶
SetExpirationDuration enables the k2hash file attributes of modification time.
func (*K2hash) SetSignalUser1 ¶
SetSignalUser1 changes log level by receiving SIGUSR1 signal.
func (*K2hash) SetSubKeys ¶
SetSubKeys links another key as a child to the key.
func (*K2hash) SetTxThreadPoolSize ¶
SetTxThreadPoolSize set the number of thread pools.
func (*K2hash) UnloadHashLibrary ¶
UnloadHashLibrary unloads the loaded hash library.
func (*K2hash) UnloadTxLibrary ¶
UnloadTxLibrary unloads the loaded hash library.
func (*K2hash) UnsetDebugFile ¶
UnsetDebugFile disables saving log messages to a file.
func (*K2hash) UnsetTxThreadPoolSize ¶
UnsetTxThreadPoolSize set the number of thread pools zero.
type KeyQueue ¶
type KeyQueue struct {
// contains filtered or unexported fields
}
KeyQueue keeps a queue configurations.
func NewKeyQueue ¶
NewKeyQueue returns a new k2hash queue instance.
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params stores parameters for k2hash C API.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue keeps a queue configurations.
type QueueParams ¶
type QueueParams struct {
// contains filtered or unexported fields
}
QueueParams stores parameters for k2hash queue C API.
type RemoveParams ¶
type RemoveParams struct {
// contains filtered or unexported fields
}
RemoveParams is a parameter set of remove.