Small fixes to type names

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby
2014-01-17 17:42:22 -08:00
parent 889b4b10ae
commit ca8dd73fbf
5 changed files with 24 additions and 23 deletions
+12 -11
View File
@@ -13,16 +13,16 @@ var (
ErrDriverNotFound = errors.New("The requested docker init has not been found")
)
var dockerInitFcts map[string]DockerInitFct
var dockerInitFcts map[string]InitFunc
type (
StartCallback func(*Process)
DockerInitFct func(i *DockerInitArgs) error
InitFunc func(i *InitArgs) error
)
func RegisterDockerInitFct(name string, fct DockerInitFct) error {
func RegisterInitFunc(name string, fct InitFunc) error {
if dockerInitFcts == nil {
dockerInitFcts = make(map[string]DockerInitFct)
dockerInitFcts = make(map[string]InitFunc)
}
if _, ok := dockerInitFcts[name]; ok {
return ErrDriverAlreadyRegistered
@@ -31,7 +31,7 @@ func RegisterDockerInitFct(name string, fct DockerInitFct) error {
return nil
}
func GetDockerInitFct(name string) (DockerInitFct, error) {
func GetInitFunc(name string) (InitFunc, error) {
fct, ok := dockerInitFcts[name]
if !ok {
return nil, ErrDriverNotFound
@@ -39,7 +39,8 @@ func GetDockerInitFct(name string) (DockerInitFct, error) {
return fct, nil
}
type DockerInitArgs struct {
// Args provided to the init function for a driver
type InitArgs struct {
User string
Gateway string
Ip string
@@ -51,6 +52,8 @@ type DockerInitArgs struct {
Driver string
}
// Driver specific information based on
// processes registered with the driver
type Info interface {
IsRunning() bool
}
@@ -58,12 +61,10 @@ type Info interface {
type Driver interface {
Run(c *Process, startCallback StartCallback) (int, error) // Run executes the process and blocks until the process exits and returns the exit code
Kill(c *Process, sig int) error
// TODO: @crosbymichael @creack wait should probably return the exit code
Wait(id string) error // Wait on an out of process...process - lxc ghosts
Version() string
Name() string
Info(id string) Info // "temporary" hack (until we move state from core to plugins)
Version() string // Driver version number
Name() string // Driver name
Info(id string) Info // "temporary" hack (until we move state from core to plugins)
}
// Network settings of the container