Example #1
0
func NewContainer(id uid.UID) *Handle {
	con := &Container{
		ExecConfig: &executor.ExecutorConfig{},
		State:      StateStopped,
	}
	con.ExecConfig.ID = id.String()
	return con.newHandle()
}
Example #2
0
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
}
Example #3
0
func GetContainer(id uid.UID) *Handle {
	// get from the cache
	container := containers.Container(id.String())
	if container != nil {
		return container.newHandle()
	}
	return nil

}
Example #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
}