jsonlrpc

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 10 Imported by: 1 module, 1 package

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.

README

jsonl-rpc

A implementation of net/rpc ClientCodec and ServerCodec, which can transfer JSONL(JSON Lines) stream.

Usage

Refer to db-proxy as ServerCodec and db-proxy-driver as ClientCodec.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(network, address string) (*rpc.Client, error)

Dial connects to server at the specified network address.

func NewClient

func NewClient(conn io.ReadWriteCloser) *rpc.Client

NewClient returns a new rpc.Client to handle requests to the set of services at the other end of the connection.

func NewClientCodec

func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewClientCodec returns a new rpc.ClientCodec on conn.

func NewServerCodec

func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewServerCodec returns a new rpc.ServerCodec on conn.

func Reconnect added in v1.0.2

func Reconnect(client **rpc.Client, maxRetry int, network, address string) func() error

func ServeConn

func ServeConn(conn io.ReadWriteCloser)

ServeConn runs the server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement.

Types

type FnCollectJSONLs added in v1.0.1

type FnCollectJSONLs func(res json.RawMessage, jsonls <-chan interface{})

type JSONLClientResponse

type JSONLClientResponse struct {
	JSONLResponse
	Result        json.RawMessage `json:"result"`
	CollectJSONLs FnCollectJSONLs `json:"-"`
}

type JSONLResponse

type JSONLResponse struct {
	Code      int    `json:"code"`
	Msg       string `json:"msg"`
	HasJSONLs bool   `json:"has-jsonls"`
}

type JSONLServerResponse

type JSONLServerResponse struct {
	JSONLResponse
	Result interface{}        `json:"result"`
	JSONLs <-chan interface{} `json:"-"`
}

Jump to

Keyboard shortcuts

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