Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { // The name of the application Name string `json:"name"` // The path to the data directory // This is where exposed files are stored DataDir string `json:"data_dir"` // The path to the working directory // This is where the application variables are stored like the database WorkDir string `json:"work_dir"` // The debuging mode Debug bool `json:"debug"` }
type CLI ¶
type CLI struct { Port string Host string WorkDir string DataDir string ConfigFile string Debug bool }
CLI struct is to store the command line arguments values
type Cert ¶
type Cert struct { // For enabling automatic certificate, delivered by Let's Encrypt // Require the Config.Server.Domain to be set and valid Auto bool `json:"auto"` // Certificate file path are uncompatible with the auto option // The path to the certificate Crt string `json:"crt"` // The path to the certificate key Key string `json:"key"` }
type Config ¶
type Config struct { // Server configuration Server Server `json:"server"` // App configuration App App `json:"app"` // UI configuration UI UI `json:"ui"` // OS store the os information OS OS `json:"-"` // The Config file path ConfigFile string `json:"-"` }
var Data Config
Data is the global configuration
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults set the default configuration values
func (*Config) SetFromCLI ¶
func (c *Config) SetFromCLI()
SeteFromCLI set the configuration values with the command line flags
func (*Config) SetFromEnv ¶
func (c *Config) SetFromEnv()
SetFromEnv set the configuration values from the environment variables
func (*Config) SetFromFile ¶
SetFromFile set the configuration values from a json file If the file does not exist, it will be created with the default values
type Server ¶
type Server struct { // The port of the server Port string `json:"port"` // The host of the server Host string `json:"host"` // A valid domain name for the server Domain string `json:"domain"` // The compression level of server responses Compression int `json:"compression"` // The maximum body size of a request MaxBodySize int `json:"max_body_size"` // The certificate for the server Cert Cert `json:"cert"` }
Click to show internal directories.
Click to hide internal directories.