router

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

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedToStopServer = errors.New("failed to stop the server")

Functions

func HandleWithCode

func HandleWithCode(handler interface{}, code int) gin.HandlerFunc

func Handler

func Handler(handler interface{}) gin.HandlerFunc

Types

type Option

type Option func(*gin.Engine)

func WithMiddleware

func WithMiddleware(middleware ...gin.HandlerFunc) Option

type Router

type Router struct {
	*fizz.Fizz
	// contains filtered or unexported fields
}

func New

func New(info *openapi.Info, opts ...Option) *Router

func (*Router) Start

func (r *Router) Start(addr string) error

func (*Router) Stop

func (r *Router) Stop(ctx context.Context) error

Stop gracefully shuts down the server. It will throw ErrFailedToStopServer if the server fails to stop.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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