httprpc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCBORClientOptions = CBORClientOptions{
	RoundTripper: httpcli.DefaultTransport,
}
View Source
var DefaultCBORServiceOptions = CBORServiceOptions{
	ServiceName:    "ldc:cborrpc",
	LoggingHeaders: []string{"user-agent", "x-request-id"},
}
View Source
var DefaultJSONClientOptions = JSONClientOptions{
	RoundTripper: httpcli.DefaultTransport,
}
View Source
var DefaultJSONServiceOptions = JSONServiceOptions{
	ServiceName:    "ldc:jsonrpc",
	LoggingHeaders: []string{"user-agent", "x-request-id"},
}

Functions

This section is empty.

Types

type CBORClient

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

func NewCBORClient

func NewCBORClient(endpoint string, 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 {
	RoundTripper http.RoundTripper
	Header       http.Header
}

type CBORService

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

func NewCBORService

func NewCBORService(h cborrpc.Handler, opts *CBORServiceOptions) *CBORService

func (*CBORService) ServeHTTP

func (s *CBORService) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CBORServiceOptions added in v0.1.0

type CBORServiceOptions struct {
	ServiceName    string
	LoggingHeaders []string
}

type JSONClient added in v0.1.0

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

func NewJSONClient added in v0.1.0

func NewJSONClient(endpoint string, 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 {
	RoundTripper http.RoundTripper
	Header       http.Header
}

type JSONService added in v0.1.0

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

func NewJSONService added in v0.1.0

func NewJSONService(h jsonrpc.Handler, opts *JSONServiceOptions) *JSONService

func (*JSONService) ServeHTTP added in v0.1.0

func (s *JSONService) ServeHTTP(w http.ResponseWriter, r *http.Request)

type JSONServiceOptions added in v0.1.0

type JSONServiceOptions struct {
	ServiceName    string
	LoggingHeaders []string
}

Jump to

Keyboard shortcuts

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