server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Latitude  = "lat"
	Longitude = "lon"
)

constant values for lat / lon

Variables

This section is empty.

Functions

func Defaults

func Defaults()

Defaults configure defaults

func Start

func Start(config ConfigSchema) (err error)

Start starts the web server

func Teardown

func Teardown() (err error)

Teardown gracefully release resources

func Validate

func Validate(schema *ConfigSchema) (err []error)

Validate a configuration

Types

type ConfigSchema

type ConfigSchema struct {
	Tz             TzSchema  `mapstructure:"tz"`
	Web            WebSchema `mapstructure:"web"`
	RuntimeVersion string    `mapstructure:"-"`
}

ConfigSchema main configuration for the news room

var Settings ConfigSchema

Settings general settings

type TzSchema

type TzSchema struct {
	DatabaseType       string `mapstructure:"database_type"`
	DatabaseName       string `mapstructure:"database_name"`
	Snappy             bool   `mapstructure:"snappy"`
	Encoding           string `mapstructure:"encoding"`
	DownloadTzData     bool   `mapstructure:"download_tz_data"`
	DownloadTzDataURL  string `mapstructure:"download_tz_data_url"`
	DownloadTzFilename string `mapstructure:"download_tz_filename"`
}

TzSchema configuration

type WebSchema

type WebSchema struct {
	ListenAddress      string  `mapstructure:"listen_address,omitempty"`
	AuthTokenValue     string  `mapstructure:"auth_token_value,omitempty"`
	AuthTokenParamName string  `mapstructure:"auth_token_param_name,omitempty"`
	RateLimit          float64 `mapstructure:"rate_limit,omitempty"`
}

WebSchema configuration

Jump to

Keyboard shortcuts

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