server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2018 License: MIT Imports: 13 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
	OAuth                 *OAuthConfig
	AppConfig             *app.Config
	DataDirectory         string
	TemplatesDirectory    string
	StaticFilesDirectory  string
	TemplatesCacheEnabled bool
	LogLevel              log.Level
}

Config holds configuration that is needed by Server to initialize all of its dependencies.

type DBConfig

type DBConfig struct {
	Driver           string
	ConnectionString string
}

DBConfig holds configuration related to the database

type HTTPServerConfig

type HTTPServerConfig struct {
	Address string
}

HTTPServerConfig holds configuration related to the HTTP server

type OAuthConfig added in v0.6.0

type OAuthConfig struct {
	Provider     string
	BaseURL      string
	ClientID     string
	ClientSecret string
}

OAuthConfig holds configuration related to the OAuth provider

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.3.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, it contains everything that is needed to serve a request.
Package app implements most of the application logic, it contains everything that is needed to serve a request.
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/endpoints/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