db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAuthorized = fmt.Errorf("not authorized")
View Source
var ErrNotFound = fmt.Errorf("not found")
View Source
var ErrRecordExists = fmt.Errorf("record exists")

Functions

func CheckRegisterNameAuthorization

func CheckRegisterNameAuthorization(txn *badger.Txn, originator, target, prev *easyecc.PublicKey) (bool, error)

func CheckSelfOrParent

func CheckSelfOrParent(txn *badger.Txn, originator, target *easyecc.PublicKey) (bool, error)

func GetParent

func GetParent(txn *badger.Txn, key *easyecc.PublicKey) (*easyecc.PublicKey, error)

Types

type BadgerDB

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

func NewBadgerDB

func NewBadgerDB(db *badger.DB) *BadgerDB

func (*BadgerDB) DisableKey

func (b *BadgerDB) DisableKey(originator *easyecc.PublicKey, key *easyecc.PublicKey) error

func (*BadgerDB) GetAddress

func (b *BadgerDB) GetAddress(name string, protocol pb.Protocol) (string, error)

func (*BadgerDB) GetKey

func (b *BadgerDB) GetKey(key *easyecc.PublicKey) (*pb.KeyRecord, error)

func (*BadgerDB) GetName

func (b *BadgerDB) GetName(name string) (*easyecc.PublicKey, error)

func (*BadgerDB) RegisterAddress

func (b *BadgerDB) RegisterAddress(originator, target *easyecc.PublicKey, name string, protocol pb.Protocol, address string) error

func (*BadgerDB) RegisterKey

func (b *BadgerDB) RegisterKey(publicKey *easyecc.PublicKey) error

func (*BadgerDB) RegisterKeyParent

func (b *BadgerDB) RegisterKeyParent(childKey *easyecc.PublicKey, parentKey *easyecc.PublicKey) error

func (*BadgerDB) RegisterName

func (b *BadgerDB) RegisterName(originator, target *easyecc.PublicKey, name string) error

func (*BadgerDB) WriteKeys added in v0.5.0

func (b *BadgerDB) WriteKeys(w protoio.Writer, cutoffTime uint64) error

Jump to

Keyboard shortcuts

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