Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // HeaderSize is the size of the header cache. HeaderSize int `mapstructure:"header-size"` // HeaderTTL is the time-to-live for headers in the cache. HeaderTTL time.Duration `mapstructure:"header-ttl"` }
Config is the configuration for an EngineCache.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for an EngineCache.
type EngineCache ¶
type EngineCache struct {
// contains filtered or unexported fields
}
EngineCache is a cache for data retrieved by the EngineClient.
func NewEngineCache ¶
func NewEngineCache( config Config, ) *EngineCache
NewEngineCacheWithConfig creates a new EngineCache with the given config.
func NewEngineCacheWithDefaultConfig ¶
func NewEngineCacheWithDefaultConfig() *EngineCache
NewEngineCache creates a new EngineCache.
func (*EngineCache) AddHeader ¶
func (c *EngineCache) AddHeader( header *primitives.ExecutionHeader, )
AddHeader adds the given header to the cache.
func (*EngineCache) HeaderByHash ¶
func (c *EngineCache) HeaderByHash( hash primitives.ExecutionHash, ) (*primitives.ExecutionHeader, bool)
HeaderByHash returns the header with the given hash.
func (*EngineCache) HeaderByNumber ¶
func (c *EngineCache) HeaderByNumber( number uint64, ) (*primitives.ExecutionHeader, bool)
HeaderByNumber returns the header with the given number.
Click to show internal directories.
Click to hide internal directories.