Documentation
¶
Index ¶
- type DockerTaskEngineState
- func (state *DockerTaskEngineState) AddContainer(container *api.DockerContainer, task *api.Task)
- func (state *DockerTaskEngineState) AddOrUpdateTask(task *api.Task) *api.Task
- func (state *DockerTaskEngineState) AddTask(task *api.Task)
- func (state *DockerTaskEngineState) AllTasks() []*api.Task
- func (state *DockerTaskEngineState) ContainerById(id string) (*api.DockerContainer, bool)
- func (state *DockerTaskEngineState) ContainerMapByArn(arn string) (map[string]*api.DockerContainer, bool)
- func (state *DockerTaskEngineState) ContainersByImage(image string) []*api.DockerContainer
- func (state *DockerTaskEngineState) Lock()
- func (state *DockerTaskEngineState) TaskByArn(arn string) (*api.Task, bool)
- func (state *DockerTaskEngineState) TaskById(cid string) (*api.Task, bool)
- func (state *DockerTaskEngineState) Unlock()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerTaskEngineState ¶
type DockerTaskEngineState struct {
// contains filtered or unexported fields
}
dockerTaskEngineState keeps track of all mappings between tasks we know about and containers docker runs It contains a mutex that can be used to ensure out-of-date state cannot be accessed before an update comes and to ensure multiple goroutines can safely work with it.
The methods on it will only aquire the read lock and it is up to the user to aquire the write lock (via Lock()) before modifying data via one of the Add* methods
Some information is duplicated in the interest of having efficient lookups
func NewDockerTaskEngineState ¶
func NewDockerTaskEngineState() *DockerTaskEngineState
func (*DockerTaskEngineState) AddContainer ¶
func (state *DockerTaskEngineState) AddContainer(container *api.DockerContainer, task *api.Task)
Users should aquire a lock before using this
func (*DockerTaskEngineState) AddOrUpdateTask ¶
func (state *DockerTaskEngineState) AddOrUpdateTask(task *api.Task) *api.Task
func (*DockerTaskEngineState) AddTask ¶
func (state *DockerTaskEngineState) AddTask(task *api.Task)
Users should aquire a lock before using this
func (*DockerTaskEngineState) AllTasks ¶
func (state *DockerTaskEngineState) AllTasks() []*api.Task
func (*DockerTaskEngineState) ContainerById ¶
func (state *DockerTaskEngineState) ContainerById(id string) (*api.DockerContainer, bool)
func (*DockerTaskEngineState) ContainerMapByArn ¶
func (state *DockerTaskEngineState) ContainerMapByArn(arn string) (map[string]*api.DockerContainer, bool)
func (*DockerTaskEngineState) ContainersByImage ¶
func (state *DockerTaskEngineState) ContainersByImage(image string) []*api.DockerContainer
func (*DockerTaskEngineState) Lock ¶
func (state *DockerTaskEngineState) Lock()
func (*DockerTaskEngineState) TaskByArn ¶
func (state *DockerTaskEngineState) TaskByArn(arn string) (*api.Task, bool)
func (*DockerTaskEngineState) TaskById ¶
func (state *DockerTaskEngineState) TaskById(cid string) (*api.Task, bool)
func (*DockerTaskEngineState) Unlock ¶
func (state *DockerTaskEngineState) Unlock()
Click to show internal directories.
Click to hide internal directories.