boltdb

package
v0.0.0-...-4cf50c0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTrustGrantBucket = "trustgrant"
	DefaultKeyPairBucket    = "keypair"
	DefaultTrustBucket      = "trust"
	LogLevelError           = "error"
	LogLevelDebug           = "debug"
)

buckets and things

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Database         string
	TrustGrantBucket string
	KeyPairBucket    string
	TrustBucket      string
	LogFunc          func(level, message string, err error)
}

Options store options

type Store

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

Store a boltdb store for the trust

func NewStore

func NewStore(opts *Options) *Store

NewStore creates a new store

func (*Store) DeleteKeyPairs

func (c *Store) DeleteKeyPairs(ids []string) error

DeleteKeyPairs deletes a list of key pairs

func (*Store) DeleteTrustGrantTokens

func (c *Store) DeleteTrustGrantTokens(tokens []string) error

DeleteTrustGrantTokens puts a registration token

func (*Store) DeleteTrusts

func (c *Store) DeleteTrusts(ids []string) error

DeleteTrusts deletes a list of trusts

func (*Store) GetKeyPairs

func (c *Store) GetKeyPairs(ids []string) ([]*types.StoredData, error)

GetKeyPairs gets all keypairs

func (*Store) GetTrustGrantTokens

func (c *Store) GetTrustGrantTokens(ids []string) ([]*types.StoredData, error)

GetTrustGrantTokens gets all the registration tokens

func (*Store) GetTrusts

func (c *Store) GetTrusts(ids []string) ([]*types.StoredData, error)

GetTrusts gets all the trusts

func (*Store) Init

func (c *Store) Init() error

Init inits the store

func (*Store) PutKeyPair

func (c *Store) PutKeyPair(keypair *types.StoredData) (string, error)

PutKeyPair puts a keypair

func (*Store) PutTrust

func (c *Store) PutTrust(trust *types.StoredData) (string, error)

PutTrust puts a trust

func (*Store) PutTrustGrantToken

func (c *Store) PutTrustGrantToken(token *types.StoredData) (string, error)

PutTrustGrantToken puts a registration token

func (*Store) Type

func (c *Store) Type() store.Type

Type returns the store type

func (*Store) WithLogFunc

func (c *Store) WithLogFunc(logFunc func(level, message string, err error)) store.Store

WithLogFunc adds a logging function to the store

type TrustClientConfigData

type TrustClientConfigData struct {
	Data string `json:"data" yaml:"data"`
}

TrustClientConfigData a json wrapper for putting config data

Jump to

Keyboard shortcuts

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