Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gambol99/distrostore
A wrapper for embedding a Consul cluster into a application
https://github.com/gambol99/distrostore
Last synced: 25 days ago
JSON representation
A wrapper for embedding a Consul cluster into a application
- Host: GitHub
- URL: https://github.com/gambol99/distrostore
- Owner: gambol99
- Created: 2015-03-16T16:18:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-19T14:18:52.000Z (almost 10 years ago)
- Last Synced: 2024-04-17T15:10:30.592Z (9 months ago)
- Language: Go
- Homepage:
- Size: 4.33 MB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/gambol99/distrostore.svg?branch=master)](https://travis-ci.org/gambol99/distrostore)
[![GoDoc](http://godoc.org/github.com/gambol99/distrostore?status.png)](http://godoc.org/github.com/gambol99/distrostore)### **Distro Store**
-----------------The Distro Store is a wrapper for [Consul](https://github.com/hashicorp/consul); the use case being you want the functionality of the Consul (raft consensus, node membership and notification, distributed key/value store, but without having to run it as a separate / external service, i.e. you want it embed into your application.
#### **Usages**
Bootstrapping the cluster and or joining a cluster
cfg := distrostore.DefaultContext()
cfg.Bootstrap = true
// set the bind interface
cfg.BindAddress = "127.0.0.1"
cfg.BindAdvertised = "127.0.0.1"
// give some datadir
cfg.DataDir = "/var/lib/somedir
store, err := distrostore.New(cfg)# bootstapping and connection to other members
(same as above, but remove the Bootstrap flag)
cfg.Members = []string{host1:port, host2:port}
store, err := distrostore.New(cfg)