libp2prpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CBORRPCProtocol     protocol.ID = "/cborrpc/v1"
	CBORRPCZstdProtocol protocol.ID = "/cborrpc/v1zstd"
)
View Source
const (
	JSONRPCProtocol     protocol.ID = "/jsonrpc/v1"
	JSONRPCZstdProtocol protocol.ID = "/jsonrpc/v1zstd"
)

Variables

View Source
var DefaultCBORClientOptions = CBORClientOptions{
	Compress: true,
}
View Source
var DefaultCBORServiceOptions = CBORServiceOptions{
	ServiceName: "ldc:cborrpc",
	Timeout:     5 * time.Second,
	HandleLog:   value.DefaultLogHandler,
}
View Source
var DefaultJSONClientOptions = JSONClientOptions{
	Compress: true,
}
View Source
var DefaultJSONServiceOptions = JSONServiceOptions{
	ServiceName: "ldc:jsonrpc",
	Timeout:     5 * time.Second,
	HandleLog:   value.DefaultLogHandler,
}

Functions

This section is empty.

Types

type CBORClient

type CBORClient struct {
	// contains filtered or unexported fields
}

func NewCBORClient

func NewCBORClient(host host.Host, endpoint peer.ID, opts *CBORClientOptions) *CBORClient

func (*CBORClient) Do

func (*CBORClient) Request

func (c *CBORClient) Request(ctx context.Context, method string, params, result any) *cborrpc.Response

type CBORClientOptions added in v0.1.0

type CBORClientOptions struct {
	Compress bool
}

type CBORService

type CBORService struct {
	// contains filtered or unexported fields
}

func NewCBORService

func NewCBORService(
	ctx context.Context, host host.Host, h cborrpc.Handler, opts *CBORServiceOptions) *CBORService

type CBORServiceOptions added in v0.1.0

type CBORServiceOptions struct {
	ServiceName string
	Timeout     time.Duration
	HandleLog   func(log *value.Log)
}

type JSONClient added in v0.1.0

type JSONClient struct {
	// contains filtered or unexported fields
}

func NewJSONClient added in v0.1.0

func NewJSONClient(host host.Host, endpoint peer.ID, opts *JSONClientOptions) *JSONClient

func (*JSONClient) Do added in v0.1.0

func (*JSONClient) Request added in v0.1.0

func (c *JSONClient) Request(
	ctx context.Context, method string, params, result any) *jsonrpc.Response

type JSONClientOptions added in v0.1.0

type JSONClientOptions struct {
	Compress bool
}

type JSONService added in v0.1.0

type JSONService struct {
	// contains filtered or unexported fields
}

func NewJSONService added in v0.1.0

func NewJSONService(
	ctx context.Context, host host.Host, h jsonrpc.Handler, opts *JSONServiceOptions) *JSONService

type JSONServiceOptions added in v0.1.0

type JSONServiceOptions struct {
	ServiceName string
	Timeout     time.Duration
	HandleLog   func(log *value.Log)
}

Jump to

Keyboard shortcuts

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