Documentation ¶
Index ¶
- type Parameter
- type Service
- func (s *Service) CurrentEpoch() spec.Epoch
- func (s *Service) CurrentSlot() spec.Slot
- func (s *Service) FirstSlotOfEpoch(epoch spec.Epoch) spec.Slot
- func (s *Service) GenesisTime() time.Time
- func (s *Service) SlotToEpoch(slot spec.Slot) spec.Epoch
- func (s *Service) StartOfEpoch(epoch spec.Epoch) time.Time
- func (s *Service) StartOfSlot(slot spec.Slot) time.Time
- func (s *Service) TimestampToEpoch(timestamp time.Time) spec.Epoch
- func (s *Service) TimestampToSlot(timestamp time.Time) spec.Slot
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 ¶
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 (*Service) CurrentEpoch ¶
CurrentEpoch provides the current epoch.
func (*Service) CurrentSlot ¶
CurrentSlot provides the current slot.
func (*Service) FirstSlotOfEpoch ¶
FirstSlotOfEpoch provides the first slot of the given epoch.
func (*Service) GenesisTime ¶
GenesisTime provides the time of the chain's genesis.
func (*Service) SlotToEpoch ¶
SlotToEpoch provides the epoch of a given slot.
func (*Service) StartOfEpoch ¶
StartOfEpoch provides the time at which a given epoch starts.
func (*Service) StartOfSlot ¶
StartOfSlot provides the time at which a given slot starts.
func (*Service) TimestampToEpoch ¶ added in v0.1.5
TimestampToEpoch provides the epoch of the given timestamp.