http

package
v0.0.0-...-bab6c82 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRenderer = &renderer{}

Functions

func MakeHandler

func MakeHandler(decoder DecoderFunc, handler HandlerFunc, formatter FormatterFunc) gin.HandlerFunc

func NewClient

func NewClient() *client

func NewRenderer

func NewRenderer(ctx context.Context, status int, component templ.Component) *renderer

func NewRouter

func NewRouter(transporters ...Transporter) *gin.Engine

Types

type DecoderFunc

type DecoderFunc func(ctx context.Context, request *http.Request) (decoded interface{}, err error)

type FormatterFunc

type FormatterFunc func(ctx context.Context, response interface{}) (templ.Component, error)

type HandlerFunc

type HandlerFunc func(ctx context.Context, request interface{}) (response interface{}, err error)

type HandlerMaker

type HandlerMaker func(decoder DecoderFunc, handler HandlerFunc, formatter FormatterFunc) gin.HandlerFunc

type Route

type Route struct {
	Method  string
	Path    string
	Handler gin.HandlerFunc
}

func NewRoute

func NewRoute(method, path string, handler gin.HandlerFunc) *Route

type Transporter

type Transporter interface {
	MakeRoutes() []*Route
}

Jump to

Keyboard shortcuts

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