http

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: GPL-3.0 Imports: 7 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, addr, serverName string, logger zerolog.Logger, metricsRegistry *metrics.Registry) (server *HttpServer, err error)

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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