Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterReloader ¶
func RegisterReloaderFlags ¶
func RegisterReloaderFlags()
func RegisterRenderer ¶
func RegisterRendererFlags ¶
func RegisterRendererFlags()
Types ¶
type Env ¶
type Env struct { // Etcd address Etcd *string // Directory inside etcd that contains the configuration EtcdDir *string // Structure that holds the configuration data in memory Data map[string]interface{} // An instance of a renderer Renderer Renderer // An instance of a reloader Reloader Reloader }
Env represents all the necessary data the core needs to run
func (*Env) BuildData ¶
Taking a etcd node and a prefix, updates the in memory data. If the etcd node represents a nested directory, this function calls recursively with the new prefix, trying to create a tree structure in memory.
func (*Env) Cycle ¶
func (env *Env) Cycle()
Cycles the rails environemnt, by rendering a new configuration file and reloading the Rails processes. Uses the existing renderer and reloader instances.
func (*Env) UpdateData ¶
func (env *Env) UpdateData(parts []string, value string, action string, data map[string]interface{})
Updates the data from an etcd watch update. Takes into consideration the type of action (set or delete) and navigates through the parts until if finds the correct node to update.
type TouchReloader ¶
type TouchReloader struct {
TouchFile *string
}
func (*TouchReloader) RegisterFlags ¶
func (reloader *TouchReloader) RegisterFlags()
func (*TouchReloader) Reload ¶
func (reloader *TouchReloader) Reload()
type YamlRenderer ¶
type YamlRenderer struct {
YamlFile *string
}
func (*YamlRenderer) RegisterFlags ¶
func (renderer *YamlRenderer) RegisterFlags()
func (*YamlRenderer) Render ¶
func (renderer *YamlRenderer) Render(env Env)
Click to show internal directories.
Click to hide internal directories.