http

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package http contains HTTP server and all required stuff for HTTP server working.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is HTTP server.

func NewServer

func NewServer(
	ctx context.Context,
	log *zap.Logger,
	cacher cache.Cacher,
	resourcesDir string,
	cfg *config.Config,
	rdb *redis.Client,
) Server

NewServer creates new server instance.

func (*Server) Register

func (s *Server) Register() error

Register server routes, middlewares, etc.

func (*Server) Start

func (s *Server) Start(ip string, port uint16) error

Start server.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop server.

Directories

Path Synopsis
Package fileserver contains static files server implementation.
Package fileserver contains static files server implementation.
handlers
api/settings
Package settings contains API handler for application settings getting.
Package settings contains API handler for application settings getting.
api/version
Package version contains version API handler.
Package version contains version API handler.
generate
Package generate contains RouterOS script generation handler.
Package generate contains RouterOS script generation handler.
healthz
Package healthz contains healthcheck handler.
Package healthz contains healthcheck handler.
metrics
Package metrics contains HTTP handler for application metrics (prometheus format) generation.
Package metrics contains HTTP handler for application metrics (prometheus format) generation.
middlewares
logreq
Package logreq contains middleware for HTTP requests logging using "zap" package.
Package logreq contains middleware for HTTP requests logging using "zap" package.
nocache
Package nocache contains middleware for HTTP response caching disabling.
Package nocache contains middleware for HTTP response caching disabling.
panic
Package panic contains middleware for panics (inside HTTP handlers) logging using "zap" package.
Package panic contains middleware for panics (inside HTTP handlers) logging using "zap" package.

Jump to

Keyboard shortcuts

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