rpc

package
v1.262.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mu *http.ServeMux, en *encoding.Map)

Register for rpc.

func Route added in v1.259.0

func Route[Req any, Res any](path string, handler Handler[Req, Res])

Route for rpc.

Types

type Client

type Client[Req any, Res any] struct {
	// contains filtered or unexported fields
}

Client for HTTP.

func NewClient

func NewClient[Req any, Res any](url string, opts ...ClientOption) *Client[Req, Res]

NewClient for rpc.

func (*Client[Req, Res]) Invoke added in v1.260.0

func (c *Client[Req, Res]) Invoke(ctx context.Context, req *Req) (res *Res, err error)

Invoke for rpc.

type ClientOption added in v1.260.0

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption for rpc.

func WithClient added in v1.260.0

func WithClient(client *http.Client) ClientOption

WithClient for rpc.

func WithContentType added in v1.261.0

func WithContentType(ct string) ClientOption

WithContentType for rpc.

type Handler

type Handler[Req any, Res any] func(ctx context.Context, req *Req) (*Res, error)

Handler for rpc.

Jump to

Keyboard shortcuts

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