connection

package
v0.43.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, rwc io.ReadWriteCloser, handler HandlerFunc) *jsonrpc2.Conn

func NewWithOptions added in v0.37.0

func NewWithOptions(ctx context.Context, rwc io.ReadWriteCloser, handler HandlerFunc, opts *Options) *jsonrpc2.Conn

Types

type HandlerFunc

type HandlerFunc func(context.Context, *jsonrpc2.Conn, *jsonrpc2.Request) (result any, err error)

type LoggingConfig

type LoggingConfig struct {
	Logger *log.Logger

	// IncludeMethods is a list of methods to include in the request log.
	// If empty, all methods are included. IncludeMethods takes precedence
	// over ExcludeMethods.
	IncludeMethods []string
	// ExcludeMethods is a list of methods to exclude from the request log.
	ExcludeMethods []string

	LogInbound  bool
	LogOutbound bool
}

func (*LoggingConfig) ShouldLog

func (cfg *LoggingConfig) ShouldLog(method string) bool

type Options

type Options struct {
	LoggingConfig LoggingConfig
}

Jump to

Keyboard shortcuts

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