base

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Transport
	Handler transport.Handler
	*transport.RoundTrips
	RunTimeout   time.Duration
	Listener     jsonrpc.Listener
	Logger       jsonrpc.Logger        // Logger for error messages
	Interceptor  transport.Interceptor // Interceptor for request/response
	RequestIdSeq uint64
	// contains filtered or unexported fields
}

func (*Client) HandleMessage

func (c *Client) HandleMessage(ctx context.Context, data []byte)

func (*Client) LastRequestID added in v0.7.3

func (c *Client) LastRequestID() jsonrpc.RequestId

LastRequestID returns the most recently generated request id without mutating the underlying sequence. It is concurrency-safe and can be used to inspect the current sequence value.

func (*Client) NextRequestID added in v0.7.1

func (c *Client) NextRequestID() jsonrpc.RequestId

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, request *jsonrpc.Notification) error

func (*Client) Send

func (c *Client) Send(ctx context.Context, request *jsonrpc.Request) (*jsonrpc.Response, error)

func (*Client) SetError

func (c *Client) SetError(err error)

type Handler

type Handler struct{}

Handler represents a default handler

func (*Handler) OnNotification

func (h *Handler) OnNotification(_ context.Context, _ *jsonrpc.Notification)

func (*Handler) Serve

func (h *Handler) Serve(_ context.Context, request *jsonrpc.Request, response *jsonrpc.Response)

type Transport

type Transport interface {
	SendData(ctx context.Context, data []byte) error
}

Transport is a base transport interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL