hc

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

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Api huma.API

Functions

func BaseHandler

func BaseHandler[I, O any](r Router, method string, path string, op RouterDoc, fn func(context.Context, *I) (*O, error))

func Delete

func Delete[I, O any](r Router, path string, op RouterDoc, fn func(context.Context, *I) (*O, error))

func Get

func Get[I, O any](r Router, path string, op RouterDoc, fn func(context.Context, *I) (*O, error))

func InitHumaClient

func InitHumaClient(router chi.Router)

func Patch

func Patch[I, O any](r Router, path string, op RouterDoc, fn func(context.Context, *I) (*O, error))

func Post

func Post[I, O any](r Router, path string, op RouterDoc, fn func(context.Context, *I) (*O, error))

Types

type CustomHumaError

type CustomHumaError struct {
	Status  int
	Message string   `json:"message"`
	Details []string `json:"details,omitempty"`
}

func (*CustomHumaError) Error

func (e *CustomHumaError) Error() string

func (*CustomHumaError) GetStatus

func (e *CustomHumaError) GetStatus() int

type Router

type Router struct {
	Api         huma.API
	Prefix      string
	Middlewares huma.Middlewares
}

Router is a wrapper around huma.Router

func InitRouter

func InitRouter(api huma.API, prefix string) Router

func (*Router) Group

func (r *Router) Group(fn func(Router))

func (*Router) Route

func (r *Router) Route(prefix string, fn func(Router))

func (*Router) Use

func (r *Router) Use(middlewares huma.Middlewares)

type RouterDoc

type RouterDoc struct {
	OperationID string
	Summary     string
	Description string
	Tags        []string
	Hidden      bool
}

Jump to

Keyboard shortcuts

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