rpc

package
v1.335.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 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, ct *content.Content, p *sync.BufferPool)

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 rpc.

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 WithClientContentType added in v1.260.0

func WithClientContentType(ct string) ClientOption

WithClientContentType for rpc.

func WithClientRoundTripper added in v1.264.0

func WithClientRoundTripper(rt http.RoundTripper) ClientOption

WithSenderRoundTripper for rpc.

func WithClientTimeout added in v1.264.0

func WithClientTimeout(timeout string) ClientOption

WithClientTimeout 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