config

package
v0.0.0-...-a997149 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MPL-2.0 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 {
	Port     int `yaml:"port"`
	Database struct {
		Kind         string `yaml:"type" mapstructure:"type"` // Database type (i.e. sqlite3, postgres, mysql, etc.)
		Addr         string `yaml:"addr" mapstructure:"addr"` // Address of database. If database type is "sqlite3", then leave this field blank
		DatabaseName string `yaml:"name" mapstructure:"name"` // Database name, or in the case of sqlite3, the path to the database
		Username     string `yaml:"user" mapstructure:"user"` // Database username
		Password     string `yaml:"pass" mapstructure:"pass"` // Database password
	} `yaml:"db" mapstructure:"db"`
	ServerSettings ServerConfig `yaml:"server" mapstructure:"server"`
}

Config is the structure containing all information needed to configure and run the server.

func GetConfig

func GetConfig(path, filename string) (*Config, error)

type ServerConfig

type ServerConfig struct {
	DebugMode bool   `yaml:"debug_mode" mapstructure:"debug_mode"` // Current server mode
	Secret    string `yaml:"secret" mapstructure:"secret"`         // JWT Secret
}

ServerConfig contains all information relevant to the server post-initialization

Jump to

Keyboard shortcuts

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