ginserver

package
v1.0.0-beta.32 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = StdConfig("default").Build()
)

Functions

func Any

func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func DELETE

func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func GET

func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func OPTIONS

func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func PATCH

func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func POST

func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func PUT

func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func Run

func Run() error

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, req *http.Request)

func Use

func Use(middleware ...gin.HandlerFunc) gin.IRoutes

Types

type Config

type Config struct {
	Mode         string            `config:"mode" desc:"Gin mode: debug,release,test. default is release"`
	Addr         string            `config:"addr" desc:"server listen addr, format is ip:port"`
	BasicAuth    map[string]string `config:"basicAuth" desc:"basicAuth. key is username, value is password"`
	ReadTimeout  time.Duration     `config:"readTimeout"`
	WriteTimeout time.Duration     `config:"writeTimeout"`
	IdleTimeout  time.Duration     `config:"idleTimeout"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(key string) *Config

func StdConfig

func StdConfig(key string) *Config

func (*Config) Build

func (c *Config) Build() *GinServer

func (*Config) Path

func (c *Config) Path() string

type Context

type Context = gin.Context

type GinServer

type GinServer struct {
	// contains filtered or unexported fields
}

func (*GinServer) Any

func (server *GinServer) Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) DELETE

func (server *GinServer) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) GET

func (server *GinServer) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) HEAD

func (server *GinServer) HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) Name

func (server *GinServer) Name() string

func (*GinServer) OPTIONS

func (server *GinServer) OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) PATCH

func (server *GinServer) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) POST

func (server *GinServer) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) PUT

func (server *GinServer) PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

func (*GinServer) RoutesInfo

func (server *GinServer) RoutesInfo() gin.RoutesInfo

func (*GinServer) Run

func (server *GinServer) Run() error

func (*GinServer) Serve

func (server *GinServer) Serve(ctx context.Context) error

func (*GinServer) ServeHTTP

func (server *GinServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*GinServer) Shutdown

func (server *GinServer) Shutdown(ctx context.Context) error

func (*GinServer) Use

func (server *GinServer) Use(middleware ...gin.HandlerFunc) gin.IRoutes

Directories

Path Synopsis
mid
ginlog
Package ginlog is gin server logger middleware.
Package ginlog is gin server logger middleware.
ginsession
Package ginsession is gin server session middleware.
Package ginsession is gin server session middleware.

Jump to

Keyboard shortcuts

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