Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beacon ¶
type Beacon interface {
// GetLatestRound fetches the latest round information from the beacon
GetLatestRound(ctx context.Context) (*Round, error)
// Start begins periodic beacon fetching
Start(ctx context.Context, interval time.Duration) error
// Stop halts beacon fetching
Stop() error
}
Beacon represents a global time source
type DrandBeacon ¶
type DrandBeacon struct {
// contains filtered or unexported fields
}
DrandBeacon implements the Beacon interface using drand
func NewDrandBeacon ¶
func NewDrandBeacon(endpoint string) (*DrandBeacon, error)
NewDrandBeacon creates a new drand beacon client
func (*DrandBeacon) GetLatestRound ¶
func (d *DrandBeacon) GetLatestRound(ctx context.Context) (*Round, error)
GetLatestRound implements Beacon.GetLatestRound
func (*DrandBeacon) Rounds ¶
func (d *DrandBeacon) Rounds() <-chan *Round
Rounds returns a channel that receives new rounds
Click to show internal directories.
Click to hide internal directories.