forked from docker-archive/deploykit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi.go
48 lines (37 loc) · 1.33 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
45
46
47
48
package group
import (
"github.com/docker/infrakit/pkg/spi"
"github.com/docker/infrakit/pkg/spi/instance"
"github.com/docker/infrakit/pkg/types"
)
// InterfaceSpec is the current name and version of the Group API.
var InterfaceSpec = spi.InterfaceSpec{
Name: "Group",
Version: "0.1.0",
}
// Plugin defines the functions for a Group plugin.
type Plugin interface {
CommitGroup(grp Spec, pretend bool) (string, error)
FreeGroup(id ID) error
DescribeGroup(id ID) (Description, error)
DestroyGroup(id ID) error
InspectGroups() ([]Spec, 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 Any can be found as the *.Spec of the plugin used.
// For instance, if the default group plugin is used, the value here will be
// an Any / encoded representation of github.com/docker/infrakit/plugin/group/types.Spec
Properties *types.Any
}
// Description is a placeholder for the reported state of a Group.
type Description struct {
Instances []instance.Description
Converged bool
}