rest

package
v1.348.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete[Res any](path string, handler content.Handler[Res])

Delete for rest.

func Error added in v1.328.0

func Error(response *resty.Response) error

Error will return an error if the response from the server is text (as server handlers return text on errors).

func Get

func Get[Res any](path string, handler content.Handler[Res])

Get for rest.

func NewClient added in v1.315.0

func NewClient(opts ...ClientOption) *resty.Client

NewClient for rest.

func Patch added in v1.317.0

func Patch[Req any, Res any](path string, handler content.RequestHandler[Req, Res])

Patch for rest.

func Post

func Post[Req any, Res any](path string, handler content.RequestHandler[Req, Res])

Post for rest.

func Put

func Put[Req any, Res any](path string, handler content.RequestHandler[Req, Res])

Put for rest.

func Register

func Register(mu *http.ServeMux, ct *content.Content)

Register for rpc.

func Route

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

Route for rest.

func RouteRequest added in v1.346.0

func RouteRequest[Req any, Res any](path string, handler content.RequestHandler[Req, Res])

RouteRequest for rest.

Types

type ClientOption added in v1.315.0

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

ClientOption for rest.

func WithClientRoundTripper added in v1.315.0

func WithClientRoundTripper(rt http.RoundTripper) ClientOption

WithSenderRoundTripper for rest.

func WithClientTimeout added in v1.315.0

func WithClientTimeout(timeout string) ClientOption

WithClientTimeout for rest.

Jump to

Keyboard shortcuts

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