Documentation ¶
Index ¶
- type Node
- func (n *Node) AverageResponseTime() time.Duration
- func (n *Node) HealthCheck()
- func (n *Node) IsHealthy() bool
- func (n *Node) Load() int64
- func (n *Node) NodeID() string
- func (n *Node) ProviderName() string
- func (n *Node) ServeHTTP(ctx *fasthttp.RequestCtx) (upstreamTook time.Duration, err error)
- func (n *Node) SetHealthy(healthy bool)
- func (n *Node) ToPromLabels() prometheus.Labels
- func (n *Node) TotalRequest() uint64
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { Name string `json:"name"` Chain string `json:"chain"` Provider string `json:"provider"` Endpoint string `json:"endpoint"` Protocol string `json:"protocol"` RateLimiter *rate.Limiter // contains filtered or unexported fields }
Node main node struct
func (*Node) AverageResponseTime ¶
AverageResponseTime average response time of this node
func (*Node) HealthCheck ¶
func (n *Node) HealthCheck()
HealthCheck a dummy healthcheck (it just recovers for now)
func (*Node) ServeHTTP ¶
ServeHTTP server http (actual proxy) through this node upstreamTook is only for the upstream request, not total (body reading & writing back to the client etc) it can be misleading when you got an error, so, count success only for accurate latency
func (*Node) ToPromLabels ¶
func (n *Node) ToPromLabels() prometheus.Labels
ToPromLabels return prometheus labels for the node
func (*Node) TotalRequest ¶
TotalRequest total request done to this node so far
Click to show internal directories.
Click to hide internal directories.