srv

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Overview

Package srv contains API routes and handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Cloning *cloning.Base

	Config *srvCfg.Config
	Global *global.Config

	Retrieval *retrieval.Retrieval
	Platform  *platform.Service
	Observer  *observer.Observer
	Estimator *estimator.Estimator
	// contains filtered or unexported fields
}

Server defines an HTTP server of the Database Lab.

func NewServer

func NewServer(cfg *srvCfg.Config, globalCfg *global.Config,
	engineProps global.EngineProps,
	dockerClient *client.Client,
	cloning *cloning.Base,
	provisioner *provision.Provisioner,
	retrievalSvc *retrieval.Retrieval,
	platform *platform.Service,
	observer *observer.Observer,
	estimator *estimator.Estimator,
	pm *pool.Manager,
	tm *telemetry.Agent) *Server

NewServer initializes a new Server instance with provided configuration.

func (*Server) InitHandlers

func (s *Server) InitHandlers()

InitHandlers initializes handler functions of the HTTP server.

func (*Server) Reload

func (s *Server) Reload(cfg srvCfg.Config)

Reload reloads server configuration.

func (*Server) Run

func (s *Server) Run() error

Run starts HTTP server on specified port in configuration.

func (*Server) Shutdown

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

Shutdown gracefully shuts down the server without interrupting any active connections.

func (*Server) Uptime

func (s *Server) Uptime() float64

Uptime returns the server uptime.

Directories

Path Synopsis
Package api contains helpers to work with HTTP requests and responses.
Package api contains helpers to work with HTTP requests and responses.
Package config contains configuration options of HTTP server.
Package config contains configuration options of HTTP server.
Package mw contains middlewares.
Package mw contains middlewares.

Jump to

Keyboard shortcuts

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