config

package
v0.0.0-...-7fac419 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server        bool   // Run as server, if different than false (server)
	Ip            string // Bind address, if different than 0.0.0.0 (server)
	Port          string // listen port, if different than '7777' (server)
	DbHandler     string // "mongo" (server)
	MongoHost     string // mongoDB host, if different than 'localhost' (server)
	MongoDbName   string // mongoDB db name, if different than 'filesrv' (server)
	MongoUsername string // mongoDB username, if any (server)
	MongoPassword string // mongoDB password, if any (server)

	RemoteHost string // imgsrv server to push files to (client)

	Map map[string]interface{} // key/value options (not used currently)
}

func ReadConfigFile

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

Given a filename to a YAML file, unmarshal it, and return a Config

func (Config) GetBool

func (c Config) GetBool(option string) (value bool)

Of the configurations, provided option, return the value as a bool

func (Config) GetString

func (c Config) GetString(option string) (value string)

Of the configurations, provided option, return the value as a string

func (*Config) Merge

func (c *Config) Merge(other *Config) error

Jump to

Keyboard shortcuts

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