-
Notifications
You must be signed in to change notification settings - Fork 17
/
client.go
40 lines (34 loc) · 869 Bytes
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package apihub
//go:generate counterfeiter . Client
type Client interface {
// Ping pings the ApiHub server.
//
// Errors:
// * Error - indicates the ApiHub API server is in a bad state.
Ping() error
// AddService adds a new service.
//
// Errors:
// * When the host is already taken.
AddService(ServiceSpec) (Service, error)
// RemoveService removes an existing service.
//
// Errors:
// * When the host is not found.
RemoveService(host string) error
// Services lists all services.
//
// Errors:
// * None.
Services() ([]Service, error)
// FindService returns the service with the specified host.
//
// Errors:
// * Service not found.
FindService(host string) (Service, error)
// UpdateService updates the service with the specified host.
//
// Errors:
// * Service not found.
UpdateService(string, ServiceSpec) (Service, error)
}