httpserver

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 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 added in v1.0.1

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