rpc

package
v1.251.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 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 HTTP.

func Unary added in v1.244.0

func Unary[Req any, Res any](path string, handler UnaryHandler[Req, Res])

Unary for rpc.

func WriteError added in v1.241.0

func WriteError(ctx context.Context, err error)

WriteError 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, contentType string, client *http.Client, enc *encoding.Map) *Client[Req, Res]

NewClient for HTTP.

func (*Client[Req, Res]) Call

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

Call for HTTP.

type UnaryHandler added in v1.244.0

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

UnaryHandler for rpc.

Jump to

Keyboard shortcuts

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