Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

onebeyond/confabulous-etcd-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This repository is not longer maintained ⚠️

This project is not longer maintained and has been archived. More details in One Beyond Governance Tiers

Build Status

Confabulous Etcd Loader

Confabulous-Etcd-Loader is an Etcd Loader for Confabulous - a hierarchical, asynchronous config loader and post processor.

TL;DR

const confabulous = require('confabulous')
const etcd = require('confabulous-etcd-loader')
const Confabulous = confabulous.Confabulous
const processors = confabulous.processors

new Confabulous()
    .add((config) => etcd({ hosts: ['etcd.example.com:2379'], key: 'config' }, [
        processors.json()
    ]))
    .on('loaded', (config) => console.log('Loaded', JSON.stringify(config, null, 2)))
    .on('reloaded', (config) => console.log('Reloaded', JSON.stringify(config, null, 2)))
    .on('error', (err) => console.error('Error', err))
    .on('reload_error', (err) => console.error('Reload Error', err))
    .end()

Options

Option Type Default Notes
hosts array Array of etcd hosts
key string Key from which to load config
mandatory boolean true Causes an error/reload_error to be emitted if the configuration does not exist
watch boolean true Uses node-etcd's watcher to monitor the key for changes
etcd object options that will be passed to the underlying etcd client.

About

A confabulous etcd loader

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published