storage

package
v0.0.0-...-0f2ae86 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStorage

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

func NewBoltStorage

func NewBoltStorage(path string) *BoltStorage

func (*BoltStorage) Close

func (bs *BoltStorage) Close()

func (*BoltStorage) CreateBucketIfNotExists

func (bs *BoltStorage) CreateBucketIfNotExists(bucketName []byte) error

func (*BoltStorage) Delete

func (bs *BoltStorage) Delete(bucketName []byte, key []byte) error

func (*BoltStorage) ForEach

func (bs *BoltStorage) ForEach(bucketName []byte, iterator func(k, v []byte) error) error

func (*BoltStorage) Get

func (bs *BoltStorage) Get(bucketName []byte, key []byte) ([]byte, error)

func (*BoltStorage) GetKeys

func (bs *BoltStorage) GetKeys(bucketName []byte) ([][]byte, error)

func (*BoltStorage) Set

func (bs *BoltStorage) Set(bucketName []byte, key []byte, value []byte) error

type EncryptedBoltStorage

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

func NewEncryptedBoltStorage

func NewEncryptedBoltStorage(path string) *EncryptedBoltStorage

func (*EncryptedBoltStorage) Close

func (ebs *EncryptedBoltStorage) Close()

func (*EncryptedBoltStorage) CreateBucketIfNotExists

func (ebs *EncryptedBoltStorage) CreateBucketIfNotExists(bucketName []byte) error

func (*EncryptedBoltStorage) Delete

func (ebs *EncryptedBoltStorage) Delete(bucketName []byte, key []byte) error

func (*EncryptedBoltStorage) ForEach

func (ebs *EncryptedBoltStorage) ForEach(bucketName []byte, iterator func(k, v []byte) error) error

func (*EncryptedBoltStorage) Get

func (ebs *EncryptedBoltStorage) Get(bucketName []byte, key []byte) ([]byte, error)

func (*EncryptedBoltStorage) GetKeys

func (ebs *EncryptedBoltStorage) GetKeys(bucketName []byte) ([][]byte, error)

func (*EncryptedBoltStorage) PassphraseToKey

func (ebs *EncryptedBoltStorage) PassphraseToKey(passphrase string) []byte

func (*EncryptedBoltStorage) Set

func (ebs *EncryptedBoltStorage) Set(bucketName []byte, key []byte, value []byte) error

func (*EncryptedBoltStorage) Unlock

func (ebs *EncryptedBoltStorage) Unlock(passphrase string)

type EncryptedStorage

type EncryptedStorage interface {
	Storage
	Unlock(passphrase string)
}

type MemBucket

type MemBucket struct {
	Keys map[string][]byte
}

type MemStorage

type MemStorage struct {
	Buckets map[string]*MemBucket
}

func NewMemStorage

func NewMemStorage() *MemStorage

func (*MemStorage) Close

func (ms *MemStorage) Close()

func (*MemStorage) CreateBucketIfNotExists

func (ms *MemStorage) CreateBucketIfNotExists(bucketName []byte) error

func (*MemStorage) Delete

func (ms *MemStorage) Delete(bucketName []byte, key []byte) error

func (*MemStorage) ForEach

func (ms *MemStorage) ForEach(bucketName []byte, iterator func(k, v []byte) error) error

func (*MemStorage) Get

func (ms *MemStorage) Get(bucketName []byte, key []byte) ([]byte, error)

func (*MemStorage) GetKeys

func (ms *MemStorage) GetKeys(bucketName []byte) ([][]byte, error)

func (*MemStorage) Set

func (ms *MemStorage) Set(bucketName []byte, key []byte, value []byte) error

type Storage

type Storage interface {
	Close()
	CreateBucketIfNotExists(bucketName []byte) error
	Set(bucketName []byte, key []byte, value []byte) error
	Get(bucketName []byte, key []byte) ([]byte, error)
	Delete(bucketName []byte, key []byte) error
	GetKeys(bucketName []byte) ([][]byte, error)
	ForEach(bucketName []byte, iterator func(k, v []byte) error) error
}

Jump to

Keyboard shortcuts

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