config

package
v0.0.0-...-78cef01 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: Apache-2.0 Imports: 3 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 {
	Phrases             []string          // A list of really chill phrases
	Replacements        map[string]string // A mapping of non-chill strings to chill strings
	StateImagesLocation string            // The url location of chill state images
}

A Config contains the various configuration settings available for the chill server.

func GetConfig

func GetConfig(parsedArgs ParsedArgs, currentUser CurrentUser, readFile ReadFile) (*Config, error)

GetConfig calculates the Config from a given config file. The config file can be specified using the command line argument "-config" or can simply exist in the users home directory under the name ".chill/config.yaml". Config files should be in the yaml file format.

type CurrentUser

type CurrentUser func() (*user.User, error)

A CurrentUser is a function that can return the user running the current program.

type ParsedArgs

type ParsedArgs struct {
	ConfigFile string
}

A ParsedArgs represents arguments given to the program at run time which can be used in the calculation of a Config struct.

type ReadFile

type ReadFile func(fileName string) ([]byte, error)

A ReadFile is a funcion that, given a fileName, will read the entire file into a byte array.

Jump to

Keyboard shortcuts

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