keystore

package
v0.0.0-...-caf495c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keystore

type Keystore struct {
	// contains filtered or unexported fields
}

Keystore

func Get

func Get(name string) *Keystore

Get retrieves a Keystore by name

func New

func New(name string, configFile *os.File, s schema.Schema, fileOn uint32, dataOnDrive bool, memOnly bool) (*Keystore, helpers.Error)

New creates a new Keystore with the provided name, schema, and other parameters.

func Restore

func Restore(name string) (*Keystore, helpers.Error)

Restore restores a Keystore by name; requires a valid config file and data folder.

func (*Keystore) Close

func (k *Keystore) Close(save bool)

Close a Keystore and save current settings to a config file if `save` is true

func (*Keystore) DataOnDrive

func (k *Keystore) DataOnDrive() bool

DataOnDrive returns the current dataOnDrive preference saved for this Keystore

func (*Keystore) Delete

func (k *Keystore) Delete() int

Delete a Keystore with the given name.

func (*Keystore) DeleteKey

func (k *Keystore) DeleteKey(key string) helpers.Error

Delete

func (*Keystore) EncryptCost

func (k *Keystore) EncryptCost() int

func (*Keystore) Get

func (k *Keystore) Get(key string) (*keystoreEntry, int)

Get a *keystoreEntry by it's key from the Keystore

func (*Keystore) GetKey

func (k *Keystore) GetKey(key string, items map[string]interface{}) (map[string]interface{}, helpers.Error)

Get

func (*Keystore) InsertKey

func (k *Keystore) InsertKey(key string, insertObj map[string]interface{}) (*keystoreEntry, helpers.Error)

Insert creates a new keystoreEntry in the Keystore, as long as one doesnt already exist

func (*Keystore) MemOnly

func (k *Keystore) MemOnly() bool

MemOnly returns the current memory-only preference saved for this Keystore

func (*Keystore) SetEncryptionCost

func (k *Keystore) SetEncryptionCost(cost int) int

SetEncryptionCost sets the bcrypt encrytion cost

func (*Keystore) SetMaxEntries

func (k *Keystore) SetMaxEntries(max uint64) int

SetMaxEntries sets the maximum entries for the Keystore

func (*Keystore) SetPartitionMax

func (k *Keystore) SetPartitionMax(max uint16) int

SetPartitionMax sets the maximum entries stored in a data file

func (*Keystore) Size

func (k *Keystore) Size() int

Size returns the number of entries in the Keystore

func (*Keystore) UpdateKey

func (k *Keystore) UpdateKey(key string, updateObj map[string]interface{}) helpers.Error

Update

func (*Keystore) UpsertKey

func (k *Keystore) UpsertKey(key string, upsertObj map[string]interface{}) (*keystoreEntry, helpers.Error)

UpsertKey

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL