pkghttp

package
v0.0.0-...-d025c41 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer[REQ any, RESP responseSet](e EndpointFn[REQ, RESP], opts ...Option[REQ, RESP]) *server[REQ, RESP]

Types

type EndpointFn

type EndpointFn[REQ any, RESP any] func(ctx context.Context, req *Request[REQ]) (resp RESP)

type EndpointMiddlewareFn

type EndpointMiddlewareFn[REQ any, RESP any] func(next EndpointFn[REQ, RESP]) EndpointFn[REQ, RESP]

type Option

type Option[REQ any, RESP responseSet] interface {
	Apply(*server[REQ, RESP])
}

func WithPreRequestMiddleware

func WithPreRequestMiddleware[REQ any, RESP responseSet](e ...EndpointMiddlewareFn[REQ, RESP]) Option[REQ, RESP]

type Request

type Request[T any] struct {
	Body   T
	Header http.Header
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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