router

package
v0.0.0-...-f0b9b21 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	*echo.Echo
	// contains filtered or unexported fields
}

Router is our HTTP router which contains echo.Echo, database.DB and WebSocket as injected dependencies.

func New

func New(
	websocket *websocket.WebSocket,
	middlewareConfig configmodels.HTTPMiddleware,
) (*Router, error)

New creates a new router instance intialized with pre-defined routes for web use.

func (*Router) Close

func (r *Router) Close()

func (*Router) EnableBasicAuth

func (r *Router) EnableBasicAuth(username, password string)

func (*Router) EnableCORS

func (r *Router) EnableCORS(
	allowCredentials bool,
	allowOrigins []string,
	allowMethods []string,
	maxAge time.Duration,
)

func (*Router) EnableGZIPCompression

func (r *Router) EnableGZIPCompression(level int)

func (*Router) EnableSwagger

func (r *Router) EnableSwagger()

func (*Router) GetPProf

func (r *Router) GetPProf(c echo.Context) error

func (*Router) HTTPErrorHandler

func (r *Router) HTTPErrorHandler(err error, c echo.Context)

func (*Router) ServeFrontend

func (r *Router) ServeFrontend(env configtypes.Environment) error

func (*Router) ServeImages

func (r *Router) ServeImages(dir string)

func (*Router) UseOpenTelemetry

func (r *Router) UseOpenTelemetry()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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