envetcd

command module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2015 License: MPL-2.0 Imports: 18 Imported by: 0

README

envetcd

Circle CI Coverage Status

envetcd provides a convienent way to populate values from etcd into a child process environment using the envetcd daemon.

The daemon envetcd allows applications to be configured with environmental variables, without having knowledge about the existence of etcd. This makes it especially easy to configure applications throughout all your environments: development, testing, production, etc.

envetcd was forked from envconsul which was inspired by envdir in its simplicity, name, and function.

Installation

You can download a released envetcd artifact from the envetcd release page on GitHub. If you wish to compile from source, you will need to have buildtools and Go installed:

$ git clone https://github.com/zvelo/envetcd.git
$ cd envetcd
$ make

This process will create envetcd which make be invoked as a binary.

Usage

Options
Option Environment Variable Default Description
peers $ENVETCD_PEERS 127.0.0.1:4001 a comma-delimited list of machine addresses in the cluster
ca-file $ENVETCD_CA_FILE certificate authority file
cert-file $ENVETCD_CERT_FILE tls client certificate file
key-file $ENVETCD_KEY_FILE tls client key file
hostname $HOSTNAME computer hostname for host specific configuration
system $ENVETCD_SYSTEM system name for system specific configuration
service $ENVETCD_SERVICE service name for service specific configuration
prefix $ENVETCD_PREFIX /config etcd prefix for all keys
log-level $ENVETCD_LOG_LEVEL WARN set log level (DEBUG, INFO, WARN, ERR)
no-sync $ENVETCD_NO_SYNC false don't synchronize cluster information before sending request
clean-env $ENVETCD_CLEAN_ENV false don't inherit any environment variables other than those pulled from etcd
no-sanitize $ENVETCD_NO_SANITIZE false don't remove bad characters from environment keys
no-upcase $ENVETCD_NO_UPCASE false don't convert all environment keys to uppercase
Command Line

The CLI interface supports all of the options detailed above.

Query the default etcd instance, rending all the keys in /config/redis, and printing the environment.

$ envetcd \
  --no-sanitize \
  --no-upcase \
  --service redis \
  --system storage \
  env

Query a local etcd instance, converting special characters in keys to undercores and uppercasing the keys:

$ envetcd \
  --peers 127.0.0.1:4001 \
  --prefix /config \
  --service redis \
  env

Examples

Redis

Redis is a command key-value storage engine. If Redis is configured to read the given environment variables, you can use envetcd to start and manage the process:

$ envetcd \
  --service redis \
  service redis start
Env

This example is a great way to see envetcd in action. In practice, it is unlikely to be a useful use of envetcd though:

$ envetcd \
  --service redis \
  env
ADDRESS=1.2.3.4
PORT=55

Contributing

To hack on envetcd, you will need a modern Go environment. To compile the envetcd binary and run the test suite, simply execute:

$ make

This will compile the envetcd binary.

If you want to run the tests:

$ make test

The etcd server default address is 127.0.0.1. To override, create the environment variable ZVELO_ETCD_HOST={etcd address}

Or to run a specific test in the suite:

go test ./... -run SomeTestFunction_name

Submit Pull Requests and Issues to the envetcd project on GitHub.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/codegangsta/negroni
Package negroni is an idiomatic approach to web middleware in Go.
Package negroni is an idiomatic approach to web middleware in Go.
_workspace/src/github.com/gogo/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/jtolds/gls
Package gls implements goroutine-local storage.
Package gls implements goroutine-local storage.
_workspace/src/github.com/smartystreets/goconvey/convey
Package convey contains all of the public-facing entry points to this project.
Package convey contains all of the public-facing entry points to this project.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method.
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock
createmock is used to generate source code for mock versions of interfaces from installed packages.
createmock is used to generate source code for mock versions of interfaces from installed packages.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate
Package generate implements code generation for mock classes.
Package generate implements code generation for mock classes.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/complicated_pkg
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/renamed_pkg
A package that calls itself something different than its package path would have you believe.
A package that calls itself something different than its package path would have you believe.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/ogletest
Package ogletest provides a framework for writing expressive unit tests.
Package ogletest provides a framework for writing expressive unit tests.
_workspace/src/github.com/smartystreets/goconvey/convey/gotest
Package gotest contains internal functionality.
Package gotest contains internal functionality.
_workspace/src/github.com/smartystreets/goconvey/convey/reporting
Package reporting contains internal functionality related to console reporting and output.
Package reporting contains internal functionality related to console reporting and output.
_workspace/src/github.com/unrolled/render
Package render is a package that provides functionality for easily rendering JSON, XML, binary data, and HTML templates.
Package render is a package that provides functionality for easily rendering JSON, XML, binary data, and HTML templates.

Jump to

Keyboard shortcuts

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