config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// OutputFileName name used for output path.
	OutputFileName = "decider.json"
	// DefaultInfoNamespace path for the info key.
	DefaultInfoNamespace = defaultNamespace + "/" + "info"
)

Variables

View Source
var ConfigDir = "/etc/dcdr"

ConfigDir default config directory.

View Source
var ExampleConfig = []byte(`
// Username = "dcdr admin"
// Namespace = "dcdr"

// Watcher {
//   OutputPath = "/etc/dcdr/decider.json"
// }

// Server {
//   JsonRoot = "dcdr"
//   Endpoint = "/dcdr.json"
// }

// Git {
//   RepoURL = "git@github.com:vsco/decider-test-config.git"
//   RepoPath = "/etc/dcdr/audit"
// }

// Stats {
//   Namespace = "decider"
//   Host = "127.0.0.1"
//   Port = 8126
// }`)

ExampleConfig an example config written by `dcdr init`

Functions

func OutputPath

func OutputPath() string

OutputPath path to write `OutputFileName`

func Path

func Path() string

Path path to config.hcl

Types

type Config

type Config struct {
	Username  string
	Namespace string
	Watcher   Watcher
	Git       Git
	Stats     Stats
	Server    Server
}

Config config struct for the `CLI`, `Client`, and `Server`

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a `Config` with default values.

func LoadConfig

func LoadConfig() *Config

LoadConfig reads config.hcl if found and merges with `DefaultConfig`.

func TestConfig

func TestConfig() *Config

TestConfig used for testing.

func (*Config) GitEnabled

func (c *Config) GitEnabled() bool

GitEnabled checks if a git repo has been configured.

func (*Config) PushEnabled

func (c *Config) PushEnabled() bool

PushEnabled checks if a git repo has a remote origin.

func (*Config) StatsEnabled

func (c *Config) StatsEnabled() bool

StatsEnabled checks if statsd has been configured.

type Git

type Git struct {
	RepoPath string
	RepoURL  string
}

Git config struct for the audit repo

type Server

type Server struct {
	Endpoint string
	Host     string
	JSONRoot string
}

Server config struct for `dcdr server`

type Stats

type Stats struct {
	Namespace string
	Host      string
	Port      int
}

Stats config struct for statsd

type Watcher

type Watcher struct {
	OutputPath string
}

Watcher config struct for `dcdr watch`

Jump to

Keyboard shortcuts

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