server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package server contains the core of the autodeb server. It creates all dependencies injects them at the right place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB                    DBConfig
	HTTP                  HTTPServerConfig
	DataDirectory         string
	TemplatesDirectory    string
	StaticFilesDirectory  string
	TemplatesCacheEnabled bool
	LogLevel              log.Level
}

Config contains configuration for Server

type DBConfig

type DBConfig struct {
	Driver           string
	ConnectionString string
}

DBConfig holds configuration related to the database

type HTTPServerConfig

type HTTPServerConfig struct {
	Address string
	Port    int
}

HTTPServerConfig holds configuration related to the HTTP server

type Server

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

Server is the main server. It has dput-compatible interface and provides REST API.

func New added in v0.4.0

func New(cfg *Config, loggingOutput io.Writer) (*Server, error)

New creates a Server

func (*Server) Shutdown added in v0.4.0

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

Shutdown will gracefully stop the server

Directories

Path Synopsis
app
Package app implements most of the application logic
Package app implements most of the application logic
Package database is responsible for all database logic.
Package database is responsible for all database logic.
Package models defines all models used within the application.
Package models defines all models used within the application.
Package router provides the main router.
Package router provides the main router.
internal/webpages
Package webpages contains handlers that serve autodeb-server's web pages
Package webpages contains handlers that serve autodeb-server's web pages

Jump to

Keyboard shortcuts

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