Versions in this module Expand all Collapse all v0 v0.1.0 Dec 9, 2022 Changes in this version + var DefaultFailureStatusCodes = []int + type ApiCaller interface + DoRequest func(context context.Context, request *http.Request) (*Response, error) + type Chain struct + func NewChain(chainData NewChainConfig) *Chain + type ChainNode struct + func NewChainNode(chainNodeData NewChainNodeConfig) *ChainNode + type ChainNodeLimit struct + Count uint + Per time.Duration + type ChainNodeStats struct + CurrentHits uint + Disabled bool + Fails uint + Limits uint + Name string + Priority int + ResponseStats map[int]uint64 + TotalHits uint64 + type ChainResponseMetadata struct + ChainId string + RequestedUrl string + Retry int + Trace []NodeTrace + type ChainStats struct + Id string + Nodes []ChainNodeStats + type CheckTick struct + MaxCheckDuration time.Duration + TickRate time.Duration + type EzNode struct + func NewEzNode(chains []*Chain, options ...Option) *EzNode + func (e *EzNode) DisableNode(chainId string, nodeName string) + func (e *EzNode) DisableNodeWithTime(chainId string, nodeName string, duration time.Duration) + func (e *EzNode) EnableNode(chainId string, nodeName string) + func (e *EzNode) GetStats() []ChainStats + func (e *EzNode) LoadStats(loadedStats []ChainStats) + func (e *EzNode) SendRequest(chainId string, request *http.Request) (*Response, error) + func (e *EzNode) SendRequestSpecific(chainId string, request *http.Request, includeNodeList []string) (*Response, error) + type EzNodeError struct + Message string + Metadata ChainResponseMetadata + func (e EzNodeError) Error() string + type NewChainConfig struct + CheckTickRate CheckTick + FailureStatusCodes []int + Id string + Nodes []*ChainNode + RetryCount int + type NewChainNodeConfig struct + Limit ChainNodeLimit + Middleware RequestMiddleware + Name string + Priority int + RequestTimeout time.Duration + Url string + type NodeTrace struct + Err error + NodeName string + StatusCode int + Time time.Time + type Option func(*EzNode) + func WithApiClient(apiCaller ApiCaller) Option + func WithSyncInterval(interval time.Duration) Option + type RequestMiddleware func(*http.Request) *http.Request + type Response struct + Body []byte + Headers *http.Header + Metadata ChainResponseMetadata + StatusCode int