srv

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package srv contains API routes and handlers.

Index

Constants

View Source
const VerificationTokenHeader = "Verification-Token"

VerificationTokenHeader defines a verification token name that should be passed in request headers.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VerificationToken string `yaml:"verificationToken"`
	Host              string `yaml:"host"`
	Port              uint   `yaml:"port"`
}

Config provides configuration for an HTTP server of the Database Lab.

type Server

type Server struct {
	Cloning  cloning.Cloning
	Config   *Config
	Platform *platform.Service
	Observer *observer.Observer
	// contains filtered or unexported fields
}

Server defines an HTTP server of the Database Lab.

func NewServer

func NewServer(cfg *Config, obsCfg *observer.Observer, cloning cloning.Cloning, platform *platform.Service,
	dockerClient *client.Client) *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 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.

Jump to

Keyboard shortcuts

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