Documentation
¶
Index ¶
- type BalancedClient
- func (c *BalancedClient) BatchCallContext(ctx context.Context, batch *jsonrpc.RpcBatch) (err error)
- func (c *BalancedClient) Call(raw *jsonrpc.RawCall) (err error)
- func (c *BalancedClient) CallContext(ctx context.Context, raw *jsonrpc.RawCall) (err error)
- func (c *BalancedClient) CallEveryUpstream(ctx context.Context, raw *jsonrpc.RawCall) (err error)
- func (c *BalancedClient) Close() error
- func (c *BalancedClient) Start() *BalancedClient
- type ClientConfig
- type EthRpcClient
- func (c *EthRpcClient) BatchCall(batch *jsonrpc.RpcBatch) error
- func (c *EthRpcClient) BatchCallContext(ctx context.Context, batch *jsonrpc.RpcBatch) error
- func (c *EthRpcClient) Call(raw *jsonrpc.RawCall) error
- func (c *EthRpcClient) CallContext(ctx context.Context, raw *jsonrpc.RawCall) error
- func (c *EthRpcClient) Close() error
- type Metrics
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalancedClient ¶
type BalancedClient struct { Clients []*ClientConfig Balancer *balancer.ClientBalancer[Upstream] Log *slog.Logger }
func NewBalancedClient ¶
func NewBalancedClient(clients []*ClientConfig, labels []any) *BalancedClient
func (*BalancedClient) BatchCallContext ¶
func (*BalancedClient) CallContext ¶
func (*BalancedClient) CallEveryUpstream ¶
func (*BalancedClient) Close ¶
func (c *BalancedClient) Close() error
func (*BalancedClient) Start ¶
func (c *BalancedClient) Start() *BalancedClient
type ClientConfig ¶
func (*ClientConfig) Close ¶
func (c *ClientConfig) Close()
func (*ClientConfig) GetLimitRps ¶
func (c *ClientConfig) GetLimitRps() uint32
func (*ClientConfig) IsConnectionError ¶
func (c *ClientConfig) IsConnectionError(err error) bool
type EthRpcClient ¶
type EthRpcClient struct {
// contains filtered or unexported fields
}
func DialContext ¶
func DialContext(ctx context.Context, rawUrl string) (*EthRpcClient, error)
func (*EthRpcClient) BatchCallContext ¶
func (*EthRpcClient) CallContext ¶
func (*EthRpcClient) Close ¶
func (c *EthRpcClient) Close() error
type Metrics ¶
type Metrics struct { // requests number and duration Requests prometheus.Histogram // number of upstreams Upstreams prometheus.Gauge }
Click to show internal directories.
Click to hide internal directories.