rpc

package
v1.260.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 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 WithClientContentType added in v1.260.0

func WithClientContentType(ct string) ClientOption

WithClientContentType 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