httpsrv

package
v0.0.0-...-5c5d7b1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc[TReq any, TRes any] func(
	c context.Context,
	req *Request[TReq],
) (*Response[TRes], error)

type Option

type Option func(g *gin.RouterGroup)

func WithPost

func WithPost[TReq any, TRes any](
	path string,
	hf HandlerFunc[TReq, TRes],
) Option

type Request

type Request[T any] struct {
	Body T
}

type Response

type Response[T any] struct {
	Headers map[string]string
	Code    int
	Data    *T
}

type Service

type Service interface {
	Register(r gin.IRouter)
}

func NewService

func NewService(prefix string, opts ...Option) Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳