crdtverse

package
v0.0.0-...-457732c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 29 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExist = errors.New("the key already exists")

Functions

func BaseTestAccessController

func BaseTestAccessController(t *testing.T, hGen pv.HostGenerator)

func BaseTestHashStore

func BaseTestHashStore(t *testing.T, hGen pv.HostGenerator)

func BaseTestLogStore

func BaseTestLogStore(t *testing.T, hGen pv.HostGenerator)

func BaseTestSignatureStore

func BaseTestSignatureStore(t *testing.T, hGen pv.HostGenerator)

func BaseTestTimeLimit

func BaseTestTimeLimit(t *testing.T, hGen pv.HostGenerator)

func BaseTestUpdatableSignatureStore

func BaseTestUpdatableSignatureStore(t *testing.T, hGen pv.HostGenerator)

func InitCryptoFuncs

func InitCryptoFuncs(gkp GenerateKeyPair, mpu MarshalPubKey, upu UnmarshalPubKey)

func MakeAddress

func MakeAddress(name, pid string, salt []byte, timeLimits ...time.Time) string

func MakeHashKey

func MakeHashKey(bHashStr string, salt []byte) string

func NewVerse

func NewVerse(hGen pv.HostGenerator, dir string, save bool, bootstraps ...peer.AddrInfo) *crdtVerse

func PubKeyToStr

func PubKeyToStr(vk IPubKey) string

Types

type GenerateKeyPair

type GenerateKeyPair func() (IPrivKey, IPubKey, error)

type IAccessBaseStore

type IAccessBaseStore interface {
	IStore
	// contains filtered or unexported methods
}

type IAccessStore

type IAccessStore interface {
	IAccessBaseStore
	IHashStore
	IUpdatableStore
	ISignatureStore
	Grant(string) error
	Verify(string) error
}

type IHashStore

type IHashStore interface {
	IStore
	MakeHashKey(string) string
}

type IKey

type IKey interface {
	Raw() ([]byte, error)
}

type IPrivKey

type IPrivKey interface {
	IKey
	Sign([]byte) ([]byte, error)
}

type IPubKey

type IPubKey interface {
	IKey
	Verify(data, sig []byte) (bool, error)
}

func StrToPubKey

func StrToPubKey(s string) (IPubKey, error)

type ISignatureStore

type ISignatureStore interface {
	IStore
	ResetKeyPair(IPrivKey, IPubKey)
}

type IStore

type IStore interface {
	Cancel()
	Close()

	Address() string
	// contains filtered or unexported methods
}

type IUpdatableSignatureStore

type IUpdatableSignatureStore interface {
	IUpdatableStore
	ISignatureStore
}

type IUpdatableStore

type IUpdatableStore interface {
	IStore
	QueryAll(...query.Query) (query.Results, error)
}

type KeyExistFilter

type KeyExistFilter struct {
	Key string
}

func (KeyExistFilter) Filter

func (f KeyExistFilter) Filter(e query.Entry) bool

type KeyMatchFilter

type KeyMatchFilter struct {
	Key string
}

data key: (<pid>)/<category>/(<tKey>)

func (KeyMatchFilter) Filter

func (f KeyMatchFilter) Filter(e query.Entry) bool

type MarshalPubKey

type MarshalPubKey func(IPubKey) ([]byte, error)

type RandomOrder

type RandomOrder struct{}

func (RandomOrder) Compare

func (o RandomOrder) Compare(_, _ query.Entry) int

type StoreOpts

type StoreOpts struct {
	Salt      []byte
	Priv      IPrivKey
	Pub       IPubKey
	TimeLimit time.Time
	Validator iValidator
}

type UnmarshalPubKey

type UnmarshalPubKey func([]byte) (IPubKey, error)

type ValueMatchFilter

type ValueMatchFilter struct {
	Val []byte
}

func (ValueMatchFilter) Filter

func (f ValueMatchFilter) Filter(e query.Entry) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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