httpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 12 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

func After

func After(routes gin.IRoutes, after ...middleware.Middleware)

func Before

func Before(routes gin.IRoutes, before ...middleware.Middleware)

func Handle

func Handle(routes gin.IRoutes, method string, path string, function interface{})

func Route

func Route(routes gin.IRoutes, method string, path string, function interface{})

Types

type Config

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

type Option

type Option func(config *Config)

func WithMiddles

func WithMiddles(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
	GetEngine() (engine *gin.Engine)
	Run(ctx context.Context) error
	Close(ctx context.Context) error
	OnShutdown(shutdownHook hook.ShutdownHook) Server
	OnBeforeRun(hook.RunHook) Server
	Route(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