tss

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMsg                = errors.New("invalid message")
	ErrNotReady                  = errors.New("not ready")
	ErrPeerNotFound              = errors.New("peer message not found")
	ErrNotEnoughBKs              = errors.New("not enough Birkhoff coefficient")
	ErrSelfBKNotFound            = errors.New("self Birkhoff coefficient not found")
	ErrInvalidBK                 = errors.New("invalid Birkhoff coefficient")
	ErrInconsistentThreshold     = errors.New("inconsistent threshold")
	ErrInconsistentPeerNumAndBks = errors.New("inconsistent peer num and bks")
	ErrInconsistentPubKey        = errors.New("inconsistent public key")
)

Functions

func GetTestID added in v1.0.2

func GetTestID(id int) string

------------ Below funcs are for testing

func GetTestPeers added in v1.0.2

func GetTestPeers(id int, lens int) []string

func GetTestPeersByArray added in v1.0.2

func GetTestPeersByArray(id int, ids []int) []string

Types

type Message added in v1.0.3

type Message[Type ~int32] interface {
	GetType() Type
}

type StopPeerManager added in v1.0.3

type StopPeerManager[Type ~int32] struct {
	types.PeerManager
	// contains filtered or unexported fields
}

func NewStopPeerManager added in v1.0.3

func NewStopPeerManager[Type ~int32](stopMessageType Type, p types.PeerManager) *StopPeerManager[Type]

func (*StopPeerManager[Type]) MustSend added in v1.0.3

func (p *StopPeerManager[Type]) MustSend(id string, message interface{})

type TestPeerManager added in v1.0.2

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

func NewTestPeerManager added in v1.0.2

func NewTestPeerManager(id int, lens int) *TestPeerManager

func NewTestPeerManagerWithPeers added in v1.0.2

func NewTestPeerManagerWithPeers(id int, peers []string) *TestPeerManager

func (*TestPeerManager) MustSend added in v1.0.2

func (p *TestPeerManager) MustSend(id string, message interface{})

Only send if the msg main exists

func (*TestPeerManager) NumPeers added in v1.0.2

func (p *TestPeerManager) NumPeers() uint32

func (*TestPeerManager) PeerIDs added in v1.0.2

func (p *TestPeerManager) PeerIDs() []string

func (*TestPeerManager) SelfID added in v1.0.2

func (p *TestPeerManager) SelfID() string

func (*TestPeerManager) Set added in v1.0.2

func (p *TestPeerManager) Set(msgMains map[string]types.MessageMain)

Jump to

Keyboard shortcuts

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