Documentation ¶
Index ¶
- Constants
- func Concat[T any](arrs ...[]T) []T
- func Cont[T comparable](haystack []T, needle T) bool
- func Contains(haystack []*drand.Participant, needle *drand.Participant) bool
- func ContainsAll(haystack, needles []*drand.Participant) bool
- func EqualParticipant(p1, p2 *drand.Participant) bool
- func ErrorContains(err error, str string) bool
- func Filter[T any](arr []T, predicate func(T) bool) []T
- func First[T any](haystack []T, predicate func(T) bool) (*T, error)
- func NonEmpty(p *drand.Participant) bool
- func ParseGroupFileBytes(groupFileBytes []byte) (*key.Group, error)
- func PublicKeyAsParticipant(identity *key.Identity) (*drand.Participant, error)
- func SortedByPublicKey(arr []*drand.Participant) []*drand.Participant
- func ToKeyNode(index int, participant *drand.Participant, sch *crypto.Scheme) (key.Node, error)
- func ToNode(index int, participant *drand.Participant, sch *crypto.Scheme) (dkg.Node, error)
- func ToParticipant(node *proto.Node) *drand.Participant
- func ToPeer(participant *drand.Participant) net.Peer
- func TryMapEach[T any](arr []*drand.Participant, ...) ([]T, error)
- func Without(haystack []*drand.Participant, needle *drand.Participant) []*drand.Participant
- type FanOutChan
Constants ¶
View Source
const MaxDKGsInFlight = 20
MaxDKGsInFlight is an arbitrary limit set for the number of DKGs in flight to avoid overallocating channel capacity for the fanout channel
Variables ¶
This section is empty.
Functions ¶
func Concat ¶
func Concat[T any](arrs ...[]T) []T
Concat combines multiple arrays of the same type into a single array
func Cont ¶
func Cont[T comparable](haystack []T, needle T) bool
Cont is contains, but the util package already contains another func just for `Participant`
func Contains ¶
func Contains(haystack []*drand.Participant, needle *drand.Participant) bool
func ContainsAll ¶
func ContainsAll(haystack, needles []*drand.Participant) bool
func EqualParticipant ¶
func EqualParticipant(p1, p2 *drand.Participant) bool
func ErrorContains ¶
func NonEmpty ¶
func NonEmpty(p *drand.Participant) bool
func PublicKeyAsParticipant ¶
func PublicKeyAsParticipant(identity *key.Identity) (*drand.Participant, error)
func SortedByPublicKey ¶
func SortedByPublicKey(arr []*drand.Participant) []*drand.Participant
func ToParticipant ¶
func ToParticipant(node *proto.Node) *drand.Participant
func TryMapEach ¶
func TryMapEach[T any](arr []*drand.Participant, fn func(index int, participant *drand.Participant) (T, error)) ([]T, error)
func Without ¶
func Without(haystack []*drand.Participant, needle *drand.Participant) []*drand.Participant
Without removes needle from the haystack. Careful: it modifies the input slice but also returns the resulting slice. It removes all instances of needle, and zeros the removed items to allow garbage collection.
Types ¶
type FanOutChan ¶
type FanOutChan[T any] struct { // contains filtered or unexported fields }
FanOutChan has one producer channel and multiple consumers for each message on the channel
func NewFanOutChan ¶
func NewFanOutChan[T any]() *FanOutChan[T]
func (*FanOutChan[T]) Chan ¶
func (f *FanOutChan[T]) Chan() chan T
func (*FanOutChan[T]) Close ¶
func (f *FanOutChan[T]) Close()
func (*FanOutChan[T]) Listen ¶
func (f *FanOutChan[T]) Listen() chan T
func (*FanOutChan[T]) StopListening ¶
func (f *FanOutChan[T]) StopListening(ch chan T)
Click to show internal directories.
Click to hide internal directories.