29 Commits

Author SHA1 Message Date
Sean Chittenden 8c464c092a json11's to_json() wants a std::map<string,string>
Don't paper over the requested types in their API.
2015-12-22 22:07:20 -08:00
Sean Chittenden 7ece12df11 Commit miss: Add agent::selfUrl()
This was needed back when consul_agent_ping() was added.  I missed this earlier because it's intermixed with the catalog nodes work.  Damn.
2015-12-22 22:06:36 -08:00
Sean Chittenden 542688597a Remove unnecessary include to iostream 2015-12-22 22:05:05 -08:00
Sean Chittenden 284a7d9abb kvUrl() returns a const string 2015-12-22 22:04:23 -08:00
Sean Chittenden 67457b8be9 Whitespace style police 2015-12-22 22:03:03 -08:00
Sean Chittenden 06e5c48394 Use agent defaults && constants in consul::Agent
Type safety in C++14 still has too many implicit exceptions.
2015-12-22 21:57:32 -08:00
Sean Chittenden c156d4536f Cleanup consul::Peer
Most of this moved to consul::Agent.  Only want one definition for these contstants.  Also reduce the number of ctors for Peer, unnecessary for now.
2015-12-22 21:51:08 -08:00
Sean Chittenden 86393514b8 Gratuitous s/hostname/host/i rename
Tired of inconsistencies between hostname and host.  There is a difference, but until the code shakes out, I'm simplifying things for now.
2015-12-22 21:49:58 -08:00
Sean Chittenden 296f147059 Add a timeout (ms) parameter
Not quite ready to bite off importing units for dimmensional analysis, but add a parameter for getting and setting the timeout.  This parameter has no effect (next few commits once a static agent per backend is initialized).
2015-12-22 20:41:25 -08:00
Sean Chittenden c268e938ee Add PostgreSQL function consul_kv_get()
Add a set returning function that fetches a particular key.  It can be called like:

  SELECT * FROM consul_kv_get('foo-key');
  SELECT * FROM consul_kv_get(key := 'test/', recurse := TRUE);
2015-11-30 14:40:20 -08:00
Sean Chittenden a5c927b1c9 Mostly complete consul_kv, now with PUT/DELETE
Round out consul_kv with GET, PUT, and DELETE support.  Recursive works with DELETE.  Both PUT and DELETE support the cas argument, -C.
2015-11-17 02:30:06 -08:00
Sean Chittenden 2ab996f0fa Add KVPairs as a collection of KVPair objects
With this, it's now possible to recursively fetch consul k/v items.
2015-11-17 00:56:09 -08:00
Sean Chittenden 597cfe276c Introduce easyloggingpp, deorbit std::cerr
I was kinda hoping I wouldn't need to introduce this, but it became clear a real logging library was prudent.
2015-11-16 23:18:39 -08:00
Sean Chittenden 59073324f7 Teach consul::Agent about recursive
Teach Agent to maintain a recursive attribute.  This should be moved downstream, but let's hold onto it here for the time being.
2015-11-16 15:09:53 -08:00
Sean Chittenden 6da31f8725 Alpha sort functions 2015-11-15 18:27:02 -08:00
Sean Chittenden 0a3db8bc9c Add the ability to specify different clusters
Use the terminology consul cluster vs consul data center.  Along with it being a bit more clear, imo, we ran out of flags.  -d is used for debugging, and -D is being used for decoding.  Using -c for cluster.
2015-11-15 18:26:49 -08:00
Sean Chittenden 55794b8083 Use the correct type information
If we're going to cast, let's cast to the right thing to begin with.  I wish C++ didn't have implicit type narrowing.
2015-11-15 18:03:38 -08:00
Sean Chittenden e696e5f9c8 Use type aliasing, not typedef where possible 2015-11-15 18:02:57 -08:00
Sean Chittenden 7b3788576c Add ::consul::KVPair
Including a simple wrapper program that can be used to fetch keys from consul.
2015-11-15 18:02:40 -08:00
Sean Chittenden c8afb6858a Introduce consul::Agent
Split out functionality from consul::Peer into consul::Agent.  consul::Agent is intended to be the interface for RPC calls to an agent (most of the time localhost:8500).
2015-11-15 17:58:07 -08:00
Sean Chittenden 1abe42c987 Modify json11 to include a TypeStr() method that returns a char*.
Walking around with this method is a PITA, just include it upstream.
2015-11-15 17:40:33 -08:00
Sean Chittenden 8873a75480 Change libb64 to include a consistent, compile-time default buffer size of 4K. 2015-11-15 17:38:40 -08:00
Sean Chittenden 37446eaee2 Import libb64 for base64 encoding and decoding support.
Importing then making a few tweaks.
2015-11-15 16:39:21 -08:00
Sean Chittenden ba39b8e39c Introduce TCLAP for arg parsing. 2015-11-15 12:31:07 -08:00
Sean Chittenden b40296e328 Mark consul::Peer final
When the library gets moved out to libconsul, I'll revisit this, but hopefully no one uses inheritance anymore w/ C++.  Right?
2015-11-14 21:58:39 -08:00