示例#1
0
文件: container.go 项目: kjplatz/vic
func NewContainer(id uid.UID) *Handle {
	con := &Container{
		ExecConfig: &executor.ExecutorConfig{},
		State:      StateStopped,
	}
	con.ExecConfig.ID = id.String()
	return con.newHandle()
}
示例#2
0
文件: container.go 项目: vmware/vic
func GetContainer(ctx context.Context, id uid.UID) *Handle {
	// get from the cache
	container := Containers.Container(id.String())
	if container != nil {
		return container.NewHandle(ctx)
	}

	return nil
}
示例#3
0
文件: container.go 项目: kjplatz/vic
func GetContainer(id uid.UID) *Handle {
	// get from the cache
	container := containers.Container(id.String())
	if container != nil {
		return container.newHandle()
	}
	return nil

}
示例#4
0
func NewContainer(id uid.UID) *Handle {
	con := &Container{
		ContainerInfo: ContainerInfo{
			state: StateCreating,
		},
		newStateEvents: make(map[State]chan struct{}),
	}

	h := newHandle(con)
	h.ExecConfig.ID = id.String()

	return h
}