httpserver

package
v0.0.0-...-a2093d6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ModeDebug = gin.DebugMode
View Source
const ModeRelease = gin.ReleaseMode
View Source
const ModeTest = gin.TestMode

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Mode string `mapstructure:"mode" json:"mode"`
	Name string `mapstructure:"name" json:"name"`
	Port int    `mapstructure:"port" json:"port"`
	// contains filtered or unexported fields
}

type Option

type Option func(config *Config)

func WithMiddlewares

func WithMiddlewares(middlewares ...middleware.Middleware) Option

func WithMode

func WithMode(mode string) Option

func WithName

func WithName(name string) Option

func WithPort

func WithPort(port int) Option

type Router

type Router func(engine *gin.Engine)

type Server

type Server interface {
	Name() (name string)
	AddMiddlewares(middlewares ...middleware.Middleware) Server
	Kernel() (engine *gin.Engine)
	Run(ctx context.Context) error
	Close(ctx context.Context) error
	OnShutdown(shutdownHook hook.ShutdownHook) Server
	OnBeforeRun(hook.RunHook) Server
	Routes(routes Router) Server
}

func NewServer

func NewServer(options ...Option) Server

func NewServerWithConfig

func NewServerWithConfig(config Config) Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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