config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config parses command line flags and config files, and defines options used elsewhere in goiardi.

Index

Constants

View Source
const ChefVersion = "11.0.11"

The chef version we're at least aiming for, even if it's not complete yet.

View Source
const Version = "0.5.0"

The goiardi version.

Variables

View Source
var Config = InitConfig()

Conf struct with the options specified on the command line or in the config file.

View Source
var LogLevelNames = map[string]int{"debug": 4, "info": 3, "warning": 2, "error": 1, "critical": 0}

Functions

func ListenAddr

func ListenAddr() string

The address and port goiardi is configured to listen on.

func ParseConfigOptions

func ParseConfigOptions() error

Read and apply arguments from the command line.

func ServerBaseURL

func ServerBaseURL() string

The base URL

func ServerHostname

func ServerHostname() string

The hostname and port goiardi is configured to use.

Types

type Conf

type Conf struct {
	Ipaddress      string
	Port           int
	Hostname       string
	ConfFile       string `toml:"conf-file"`
	IndexFile      string `toml:"index-file"`
	DataStoreFile  string `toml:"data-file"`
	DebugLevel     int    `toml:"debug-level"`
	LogLevel       string `toml:"log-level"`
	FreezeInterval int    `toml:"freeze-interval"`
	FreezeData     bool   `toml:"freeze-data"`
	LogFile        string `toml:"log-file"`
	UseAuth        bool   `toml:"use-auth"`
	TimeSlew       string `toml:"time-slew"`
	TimeSlewDur    time.Duration
	ConfRoot       string  `toml:"conf-root"`
	UseSSL         bool    `toml:"use-ssl"`
	SslCert        string  `toml:"ssl-cert"`
	SslKey         string  `toml:"ssl-key"`
	HttpsUrls      bool    `toml:"https-urls"`
	DisableWebUI   bool    `toml:"disable-webui"`
	UseMySQL       bool    `toml:"use-mysql"`
	MySQL          MySQLdb `toml:"mysql"`
	LocalFstoreDir string  `toml:"local-filestore-dir"`
}

Master struct for configuration.

func InitConfig

func InitConfig() *Conf

type MySQLdb added in v0.5.0

type MySQLdb struct {
	Username    string
	Password    string
	Protocol    string
	Address     string
	Port        string
	Dbname      string
	ExtraParams map[string]string `toml:"extra_params"`
}

MySQL connection options

type Options

type Options struct {
	Version        bool   `short:"v" long:"version" description:"Print version info."`
	Verbose        []bool `short:"V" long:"verbose" description:"Show verbose debug information. Repeat for more verbosity."`
	ConfFile       string `short:"c" long:"config" description:"Specify a config file to use."`
	Ipaddress      string `short:"I" long:"ipaddress" description:"Listen on a specific IP address."`
	Hostname       string `short:"H" long:"hostname" description:"Hostname to use for this server. Defaults to hostname reported by the kernel."`
	Port           int    `short:"P" long:"port" description:"Port to listen on. If port is set to 443, SSL will be activated. (default: 4545)"`
	IndexFile      string `short:"i" long:"index-file" description:"File to save search index data to."`
	DataStoreFile  string `short:"D" long:"data-file" description:"File to save data store data to."`
	FreezeInterval int    `` /* 208-byte string literal not displayed */
	LogFile        string `short:"L" long:"log-file" description:"Log to file X"`
	TimeSlew       string `` /* 171-byte string literal not displayed */
	ConfRoot       string `` /* 172-byte string literal not displayed */
	UseAuth        bool   `short:"A" long:"use-auth" description:"Use authentication. Default: false."`
	UseSSL         bool   `` /* 222-byte string literal not displayed */
	SslCert        string `long:"ssl-cert" description:"SSL certificate file. If a relative path, will be set relative to --conf-root."`
	SslKey         string `long:"ssl-key" description:"SSL key file. If a relative path, will be set relative to --conf-root."`
	HttpsUrls      bool   `` /* 239-byte string literal not displayed */
	DisableWebUI   bool   `long:"disable-webui" description:"If enabled, disables connections and logins to goiardi over the webui interface."`
	UseMySQL       bool   `long:"use-mysql" description:"Use a MySQL database for data storage. Configure database options in the config file."`
	LocalFstoreDir string `` /* 144-byte string literal not displayed */
}

Struct for command line options.

Jump to

Keyboard shortcuts

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