http

package
v1.0.2-0...-4498715 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 20 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.
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