drng

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0, BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DRNG

type DRNG struct {
	State  *state.State // The state of the DRNG.
	Events *Event       // The events fired on the DRNG.
}

DRNG holds the state and events of a drng instance.

func New

func New(setters ...state.Option) *DRNG

New creates a new DRNG instance.

func (*DRNG) Dispatch

func (drng *DRNG) Dispatch(issuer ed25519.PublicKey, timestamp time.Time, payload *payload.Payload) error

Dispatch parses a DRNG message and process it based on its subtype

type Event

type Event struct {
	// Collective Beacon is triggered each time we receive a new CollectiveBeacon message.
	CollectiveBeacon *events.Event
	// Randomness is triggered each time we receive a new and valid CollectiveBeacon message.
	Randomness *events.Event
}

Event holds the different events triggered by a DRNG instance.

Directories

Path Synopsis
subtypes

Jump to

Keyboard shortcuts

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