forked from docker-archive/deploykit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi.go
44 lines (32 loc) · 1.15 KB
/
spi.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
41
42
43
44
package group
import (
"encoding/json"
"github.com/docker/infrakit/spi/instance"
)
// Plugin defines the functions for a Group plugin.
type Plugin interface {
WatchGroup(grp Spec) error
UnwatchGroup(id ID) error
InspectGroup(id ID) (Description, error)
DescribeUpdate(updated Spec) (string, error)
UpdateGroup(updated Spec) error
StopUpdate(id ID) error
DestroyGroup(id ID) error
}
// ID is the unique identifier for a Group.
type ID string
// Spec is the specification for a Group. The full schema for a Group is defined by the plugin.
// In general, a Spec of an entity is set as the raw JSON value of another object's Properties.
type Spec struct {
// ID is the unique identifier for the group.
ID ID
// Properties is the configuration for the group.
// The schema for the raw JSON can be found as the *.Spec of the plugin used.
// For instance, if the default group plugin is used, the value here will be
// a JSON representation of github.com/docker/infrakit/plugin/group/types.Spec
Properties *json.RawMessage
}
// Description is a placeholder for the reported state of a Group.
type Description struct {
Instances []instance.Description
}