base

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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