client

package
v2.0.6-testnet Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Get returns the randomness at `round` or an error.
	// Requesting round = 0 will return randomness for the most
	// recent known round, bounded at a minimum to the `RoundAt(time.Now())`
	Get(ctx context.Context, round uint64) (Result, error)

	// Watch returns new randomness as it becomes available.
	Watch(ctx context.Context) <-chan Result

	// Info returns the parameters of the chain this client is connected to.
	// The public key, when it started, and how frequently it updates.
	Info(ctx context.Context) (*chain.Info, error)

	// RoundAt will return the most recent round of randomness that will be available
	// at time for the current client.
	RoundAt(time time.Time) uint64

	// Closer means Close() will halt the client, any background processes it runs and any
	// in-flight Get, Watch or Info requests. Behavior for usage of the client
	// after Close is called is undefined.
	io.Closer
}

Client represents the drand Client interface.

type LoggingClient

type LoggingClient interface {
	SetLog(log.Logger)
}

LoggingClient sets the logger for use by clients that support it

type Result

type Result interface {
	GetRound() uint64
	GetRandomness() []byte
	GetSignature() []byte
}

Result represents the randomness for a single drand round.

Jump to

Keyboard shortcuts

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