standard

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithGenesisTimeProvider

func WithGenesisTimeProvider(provider eth2client.GenesisTimeProvider) Parameter

WithGenesisTimeProvider sets the genesis time provider.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithSlotDurationProvider

func WithSlotDurationProvider(provider eth2client.SlotDurationProvider) Parameter

WithSlotDurationProvider sets the seconds per slot provider.

func WithSlotsPerEpochProvider

func WithSlotsPerEpochProvider(provider eth2client.SlotsPerEpochProvider) Parameter

WithSlotsPerEpochProvider sets the slots per epoch provider.

type Service

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

Service provides chain time services.

func New

func New(ctx context.Context, params ...Parameter) (*Service, error)

New creates a new controller.

func (*Service) CurrentEpoch

func (s *Service) CurrentEpoch() uint64

CurrentEpoch provides the current epoch.

func (*Service) CurrentSlot

func (s *Service) CurrentSlot() uint64

CurrentSlot provides the current slot.

func (*Service) FirstSlotOfEpoch

func (s *Service) FirstSlotOfEpoch(epoch uint64) uint64

FirstSlotOfEpoch provides the first slot of the given epoch.

func (*Service) GenesisTime

func (s *Service) GenesisTime() time.Time

GenesisTime provides the time of the chain's genesis.

func (*Service) SlotToEpoch

func (s *Service) SlotToEpoch(slot uint64) uint64

SlotToEpoch provides the epoch of a given slot.

func (*Service) StartOfEpoch

func (s *Service) StartOfEpoch(epoch uint64) time.Time

StartOfEpoch provides the time at which a given epoch starts.

func (*Service) StartOfSlot

func (s *Service) StartOfSlot(slot uint64) time.Time

StartOfSlot provides the time at which a given slot starts.

Jump to

Keyboard shortcuts

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