Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router interface { // BuildPath builds the path for the request and returns a map of Node addresses to their respective paths BuildPath(path string, query any, nodes []model.NodeEndpointCache) (map[common.Address]string, error) // DistributeRequest sends the request to the Nodes and processes the results DistributeRequest(ctx context.Context, nodeMap map[common.Address]string, processResults func([]model.DataResponse)) (model.DataResponse, error) }
type SimpleRouter ¶
type SimpleRouter struct {
// contains filtered or unexported fields
}
func NewSimpleRouter ¶
func NewSimpleRouter(httpClient httputil.Client) *SimpleRouter
func (*SimpleRouter) BuildPath ¶
func (r *SimpleRouter) BuildPath(method, path string, query url.Values, nodes []*model.NodeEndpointCache, body []byte) (map[common.Address]model.RequestMeta, error)
func (*SimpleRouter) DistributeRequest ¶
func (r *SimpleRouter) DistributeRequest(ctx context.Context, nodeMap map[common.Address]model.RequestMeta, processResponses func([]*model.DataResponse)) (model.DataResponse, error)
Click to show internal directories.
Click to hide internal directories.