config

package
v0.0.0-...-24e25d4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DB represents a gorm DB
	DB *gorm.DB
	// ContentDB represents a content gorm DB
	ContentDB *gorm.DB
)

Functions

func Title

func Title() string

Title is title of site

Types

type Config

type Config struct {
	IsDebugMode     bool     `toml:"debug" desc:"Enable debug mode"`
	IsDevMode       bool     `toml:"dev" desc:"Run in deveopment mode"`
	Title           string   `toml:"title" desc:"default title name"`
	Host            string   `toml:"host" desc:"host to listen on, e.g. :80"`
	Database        Database `toml:"database" desc:"database"`
	ContentDatabase Database `toml:"content_database" desc:"database"`
}

Config wraps all configuration options

func New

func New() (*Config, error)

New loads the config system

func (*Config) Verify

func (c *Config) Verify() error

Verify config options

type Database

type Database struct {
	Username string `toml:"username" desc:"username, e.g. eqemu"`
	Password string `toml:"password" desc:"password, e.g. eqemupass"`
	Host     string `toml:"host" desc:"host:port string, e.g. localhost:3306"`
	Database string `toml:"database" desc:"database name, e.g. eqemu"`
}

Database contains connection info

Jump to

Keyboard shortcuts

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