config

package
v0.0.0-...-c99bb84 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StationsInformationUrl string
	StationsStatusUrl      string

	AppIdentifier string
	Http          Http
	ViewConfig    ViewConfig
}

Config is the main configuration struct, holding sub-structs for each type of configuration.

var (
	AppConfig Config // AppConfig is a global variable used to access the config struct.
)

func GetDefaultConfig

func GetDefaultConfig() Config

GetDefaultConfig populates the default configuration struct.

func LoadConfig

func LoadConfig() Config

LoadConfig does as the name suggests - loads the config. If the config.toml file is not found, it will create one using the default config defined in getDefaultConfig().

type Http

type Http struct {
	Port int

	UseHttp  bool
	UseSSL   bool
	SSLPort  int
	CertFile string
	Keyfile  string
}

Http represents settings and variables related to the http server.

type ViewConfig

type ViewConfig struct {
	BaseURI   string
	Folder    string
	Extension string
	BaseFile  string
	Caching   bool
}

ViewConfig represents the configuration used to render views.

Jump to

Keyboard shortcuts

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