http

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpServer

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

func NewHttpServer

func NewHttpServer(ctx context.Context, name, addr string, log zerolog.Logger, middlewares ...gin.HandlerFunc) (server *HttpServer, err error)

func (*HttpServer) Address added in v0.0.21

func (server *HttpServer) Address() string

func (*HttpServer) LogRegisteredRoutes added in v0.0.24

func (server *HttpServer) LogRegisteredRoutes()

func (*HttpServer) Name added in v0.0.21

func (server *HttpServer) Name() string

info functions

func (*HttpServer) RegisterGlobalMiddleware

func (server *HttpServer) RegisterGlobalMiddleware(handlers ...gin.HandlerFunc) error

func (*HttpServer) RegisterRoute

func (server *HttpServer) RegisterRoute(path, method string, handlers ...gin.HandlerFunc) error

func (*HttpServer) RegisterRouteGroup

func (server *HttpServer) RegisterRouteGroup(group RoutingGroup) error

func (*HttpServer) ServeHTTP

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

func (*HttpServer) Start

func (server *HttpServer) Start() error

type RoutingGroup

type RoutingGroup struct {
	Base       string
	Middleware []gin.HandlerFunc
	Routes     map[string]map[string][]gin.HandlerFunc // path:method:handlers
	Groups     []RoutingGroup
	Static     []StaticRoute
}

func (RoutingGroup) Register added in v0.0.23

func (rg RoutingGroup) Register(registrator grouper) (err error)

type StaticRoute added in v0.0.25

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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