config

package
v0.0.0-...-303912c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WUNDERTOOLS_PROJECT_CONF_FOLDER = ".wundertools"
	WUNDERTOOLS_USER_CONF_SUBPATH   = "wundertools"
)
View Source
const (
	WUNDERTOOLS_CONFIG_APPLICATION_YAML_PATH = "settings.yml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name   string
	Author string

	Environment string

	*Paths
}

Configuration for an application

func DefaultApplication

func DefaultApplication(workingDir string) *Application

func (*Application) AlterService

func (app *Application) AlterService(service *libCompose_config.ServiceConfig)

*

  • clean up a service based on this app

func (*Application) Init

func (app *Application) Init()

quick initializer/constructor

type Paths

type Paths struct {
	// contains filtered or unexported fields
}

Struct used to keep path information

func (*Paths) DefaultPaths

func (paths *Paths) DefaultPaths(workingDir string)

do some discovery of paths based on a pwd

func (*Paths) DiscoverProjectPaths

func (paths *Paths) DiscoverProjectPaths(workingDir string)

*

  • Discover project paths *
  • Recursively navigate up the file path until we discover a folder that
  • has the key configuration subfolder in it. That path is marked as the
  • application root, and the subfolder is marked as a conf path

func (*Paths) DiscoverUserPaths

func (paths *Paths) DiscoverUserPaths()

*

  • Discover some user paths *
  • @NOTE we have to play some games for different OSes here *
  • dependening on OS, determine if the user has any settings
  • if so, add a conf path for them.

func (*Paths) Init

func (paths *Paths) Init()

quick constructor/initializer

func (*Paths) OrderedConfPathKeys

func (paths *Paths) OrderedConfPathKeys() []string

get all of the conf path keys in order

func (*Paths) Path

func (paths *Paths) Path(key string) (path string, found bool)

get a path from a key

func (*Paths) SetPath

func (paths *Paths) SetPath(key string, path string, isConf bool)

set a path using a key and path, optionally defined it as a configuration root

Jump to

Keyboard shortcuts

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