host: Ports host rpc functions to http

Signed-off-by: Corey Powell <mistdragon100@gmail.com>
cluster: Move RandomJobID to utils.go.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
WIP sampi client
WIP host client
host,pkg,controller: Get rid of AddJobsRes & AddJobsReq

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

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Remove redundant parameter in RegisterHost.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host/sampi/http.go

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: 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>
host: Fix StreamHostEvents.

Closing the channel emits an event by itself, we don't need to send a value.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host, pkg/cluster: Get rid of NewClientWithID.

Was used for RPC to get around some bugs, and we don't use selfID anywhere in
the code anymore.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
pkg/cluster: Update RemoveJob signature.

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