web

package
v0.0.0-...-2dd569a Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	Name    string
	Handler func(next http.Handler) http.Handler
}

type RouteHandler

type RouteHandler struct {
	Path        string
	Method      string
	HandlerFunc http.HandlerFunc
}

type WebRouter

type WebRouter struct {
	HelloWebHandler       handlers.HelloWebHandlerInterface
	RateLimiterMiddleware middlewares.RateLimiterMiddlewareInterface
}

func NewWebRouter

func NewWebRouter(
	helloWebHandler handlers.HelloWebHandlerInterface,
	rateLimiterMiddleware middlewares.RateLimiterMiddlewareInterface,
) *WebRouter

func (*WebRouter) Build

func (wr *WebRouter) Build() []RouteHandler

func (*WebRouter) BuildMiddlewares

func (wr *WebRouter) BuildMiddlewares() []Middleware

type WebRouterInterface

type WebRouterInterface interface {
	Build() []RouteHandler
}

type WebServer

type WebServer struct {
	Router        chi.Router
	Handlers      []RouteHandler
	Middlewares   []Middleware
	WebServerPort int
}

func NewWebServer

func NewWebServer(
	serverPort int,
	handlers []RouteHandler,
	middlewares []Middleware,
) *WebServer

func (*WebServer) Start

func (s *WebServer) Start()

type WebServerInterface

type WebServerInterface interface {
	Start()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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