config

package
v0.0.0-...-285b632 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: MIT Imports: 4 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 {
	MoneyGo MoneyGo
	Https   Https
}

func ReadConfig

func ReadConfig(filename string) (*Config, error)

type DbType

type DbType uint
const (
	SQLite DbType = 1 + iota
	MySQL
	Postgres
)

func (*DbType) FromString

func (e *DbType) FromString(in string) error

func (DbType) String

func (e DbType) String() string

func (*DbType) UnmarshalText

func (e *DbType) UnmarshalText(text []byte) error

func (DbType) Valid

func (e DbType) Valid() bool

type Https

type Https struct {
	CertFile           string `gcfg:"cert-file"`
	KeyFile            string `gcfg:"key-file"`
	GenerateCerts      bool   `gcfg:"generate-certs-if-absent"` // Generate certificates if missing
	GenerateCertsHosts string `gcfg:"generate-certs-hosts"`     // Hostnames to generate certificates for if missing and GenerateCerts==true
}

type MoneyGo

type MoneyGo struct {
	Fcgi    bool   // whether to serve FCGI (HTTP by default if false)
	Port    int    // port to serve API/files on
	Basedir string `gcfg:"base-directory"` // base directory for serving files out of
	DBType  DbType `gcfg:"db-type"`        // Whether this is a sqlite/mysql/postgresql database
	DSN     string `gcfg:"db-dsn"`         // 'Data Source Name' for database connection
}

Jump to

Keyboard shortcuts

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