Documentation ¶
Overview ¶
Package jrpc implements a jsonrpc2 server
Index ¶
- Variables
- func Call[T any](ctx context.Context, c Conn, method string, args ...any) (*T, error)
- func Do[T any](ctx context.Context, c Conn, method string, args any) (*T, error)
- type BatchElem
- type Conn
- type Handler
- type HandlerFunc
- type Middleware
- type Request
- type ResponseWriter
- type Server
- type StreamingConn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NewServer creates a jrpc server NewServer = server.NewServer // DialContext is to dial a conn with context DialContext = codecs.DialContext // Dial is to dial a conn with context.Background() Dial = codecs.Dial // ContextWithConn will attach a conn to the context ContextWithConn = codec.ContextWithConn // ContextWithPeerInfo will attach a peerinfo to the context ContextWithPeerInfo = server.ContextWithPeerInfo // ConnFromContext will retrieve a conn from context ConnFromContext = codec.ConnFromContext // PeerInfoFromContext will retrieve a peerinfo from context PeerInfoFromContext = server.PeerInfoFromContext )
View Source
var CallInto = codec.CallInto
CallInto is the same as Call, except instead of returning, you provide a pointer to the result
Functions ¶
Types ¶
type HandlerFunc ¶
type HandlerFunc = codec.HandlerFunc
HandlerFunc is a Handler that exists as a function
type Middleware ¶ added in v0.2.22
Middleware is a middleware
type ResponseWriter ¶
type ResponseWriter = codec.ResponseWriter
ResponseWriter is used to write responses to the request
type StreamingConn ¶
type StreamingConn = codec.StreamingConn
StreamingConn is a conn that supports streaming methods
Click to show internal directories.
Click to hide internal directories.