containerd/api/v1/types.go

51 lines
1.2 KiB
Go
Raw Normal View History

2015-11-05 23:29:53 +00:00
package v1
type State struct {
Containers []Container `json:"containers"`
}
type Status string
const (
Paused Status = "paused"
Running Status = "running"
)
type ContainerState struct {
Status Status `json:"status,omitempty"`
}
2015-11-05 23:29:53 +00:00
type Container struct {
ID string `json:"id,omitempty"`
BundlePath string `json:"bundlePath,omitempty"`
Processes []Process `json:"processes,omitempty"`
2015-11-13 21:22:42 +00:00
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
State *ContainerState `json:"state,omitempty"`
}
type User struct {
UID uint32 `json:"uid"`
GID uint32 `json:"gid"`
AdditionalGids []uint32 `json:"additionalGids,omitempty"`
}
type Process struct {
Terminal bool `json:"terminal"`
User User `json:"user"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
Cwd string `json:"cwd,omitempty"`
Pid int `json:"pid,omitempty"`
2015-11-05 23:29:53 +00:00
}
2015-11-10 21:44:35 +00:00
type Signal struct {
Signal int `json:"signal"`
}
type Event struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Status int `json:"status,omitempty"`
}