web

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapError

func MapError(err error) error

func OptionAuthToken

func OptionAuthToken() func(route *fuego.BaseRoute)

func SetupRoutes

func SetupRoutes(server *fuego.Server, routerList ...RouterContract) error

Types

type DefaultController

type DefaultController struct{}

func (DefaultController) HTTPError

func (ctrl DefaultController) HTTPError(statusCode int, err error) *fuego.HTTPError

func (DefaultController) HandleError

func (ctrl DefaultController) HandleError(err error) error

func (DefaultController) ParamID

func (ctrl DefaultController) ParamID(req *http.Request) (entities.HexID, error)

func (DefaultController) ParseHexID

func (ctrl DefaultController) ParseHexID(rawValue string) (entities.HexID, error)

type HttpMiddleware

type HttpMiddleware = func(http.Handler) http.Handler

type RouterContract

type RouterContract interface {
	RegisterRoutes(server *fuego.Server) error
	GroupName() string
	Middlewares() []HttpMiddleware
}

type RouterMiddlewareExtender

type RouterMiddlewareExtender interface {
	AddMiddleware(middleware HttpMiddleware)
}

type RouterWithSubRouter

type RouterWithSubRouter interface {
	SubRouters() (subgroupPattern string, routers []RouterContract)
}

type Server

type Server struct {
	*fuego.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	conf config.Config,
	jwtPublicKey *rsa.PublicKey,
	serverOptions ...ServerOption,
) (*Server, error)

func (*Server) Run

func (s *Server) Run() error

type ServerOption

type ServerOption func(*Server)

func WithPrivateRouters

func WithPrivateRouters(routers ...RouterContract) ServerOption

func WithPublicRouters

func WithPublicRouters(routers ...RouterContract) ServerOption

Directories

Path Synopsis
handlers
middlewares

Jump to

Keyboard shortcuts

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