http

package
v0.0.0-...-b9cf7ac Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceHeaderKey    = "x-b3-traceid"
	UsernameHeaderKey = "x-username"
)
View Source
const (
	CookieSessionKey = "session"
)

Variables

This section is empty.

Functions

func NewAuthMiddleware

func NewAuthMiddleware(cfg *config.AppConfig, st store.Store) fiber.Handler

NewAuthMiddleware returns auth middleware

func NewLoggingMiddleware

func NewLoggingMiddleware(logger *log.Log) fiber.Handler

NewLogger returns request/response logging middleware

func SetNewSession

func SetNewSession(c *fiber.Ctx, cfg *config.AppConfig, st store.Store, username string) error

func StartHTTPServer

func StartHTTPServer(lifecycle fx.Lifecycle, server Server, logger *log.Log)

Types

type Params

type Params struct {
	fx.In
	HTTPConfig *config.HTTPConfig
	AppConfig  *config.AppConfig
	Logger     *log.Log
	Eh         errhandler.ErrorHandler
	Store      store.Store
}

type Server

type Server interface {
	RunServer(logger *log.Log)
	Shutdown(logger *log.Log) error
	GetBaseRouter() fiber.Router
	GetAPIRouter() fiber.Router
}

Server describes methods available for the REST server.

func NewHTTPServer

func NewHTTPServer(params Params) Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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