Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶ added in v0.3.0
type Interceptor interface {
// Intercept is called after a response is received for a specific method (even if it's an error)
// It receives the context, original request, and the response
// If it returns a non-nil request, that request will be sent as a follow-up
// If it returns nil, no additional request will be sent
Intercept(ctx context.Context, request *jsonrpc.Request, response *jsonrpc.Response) (*jsonrpc.Request, error)
}
Interceptor defines an interface for intercepting JSON-RPC requests and responses for specific methods It allows for method-level post-processing of responses and optionally sending additional requests
type NewHandler ¶
NewHandler is a function that creates a new Handler
type Notifier ¶
type Notifier interface {
Notify(ctx context.Context, notification *jsonrpc.Notification) error
}
Notifier represents a notification handler
type RoundTrip ¶
type RoundTrip struct {
Request *jsonrpc.Request
Response *jsonrpc.Response
// contains filtered or unexported fields
}
RoundTrip represents a trip
func NewRoundTrip ¶
NewRoundTrip creates a new round trip
func (*RoundTrip) SetResponse ¶
SetResponse sets the response
type RoundTrips ¶
type RoundTrips struct {
Ring []*RoundTrip
// contains filtered or unexported fields
}
RoundTrips represents a collection of trips
func NewRoundTrips ¶
func NewRoundTrips(capacity int) *RoundTrips
NewRoundTrips creates a new round trips
func (*RoundTrips) Add ¶
func (r *RoundTrips) Add(request *jsonrpc.Request) (*RoundTrip, error)
Add adds a new trip
func (*RoundTrips) CloseWithError ¶
func (r *RoundTrips) CloseWithError(err error)
CloseWithError closes trips with error
func (*RoundTrips) Get ¶
func (r *RoundTrips) Get(index int) *RoundTrip
Get returns the trip at the given index
Click to show internal directories.
Click to hide internal directories.