cluster: Move RandomJobID to utils.go.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Register host routes.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
WIP sampi client
WIP host client
host, pkg, cluster: Ports host rpc functions to http

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
host: Routes should use the hostMiddleware

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
host,pkg,controller: Get rid of AddJobsRes & AddJobsReq

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
add support for streaming for listJobs and getJob.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
get rid of the redundant parameter in RegisterHost

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
cleanup

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
wip add streams in sampi

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
register Sampi routes

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
pkg: cluster, fixed typos and returns

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
controller, host, pkg: ListHosts returns an Array of host.Host

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
bootstrap, controller, pkg, test: Standardize event channels

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
bootstrap, controller, pkg, test: all Client methods should return an error
host: And then http fixes had to happen...

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
host: Share the same port for attach and host API.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Share the same port with the Sampi API as well.

Sampi functions simply get mounted on the current leader.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Fix stopping RegisterHost.

When the connection terminates, Sampi needs to be notified, and close the stream
and unregister the host. We could probably further simplify the code if we
merged registerHost and RegisterHost.

We might consider sending a keep-alive heartbeat signal, or some other way of
ensuring the host is still up, as I do not know how reliable CloseNotifier is.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>