Documentation ¶
Index ¶
- Constants
- func ClearContainerHandlerFactories()
- func RegisterContainerHandlerFactory(factory ContainerHandlerFactory)
- type ContainerHandler
- type ContainerHandlerFactory
- type FactoryForMockContainerHandler
- type ListType
- type MockContainerHandler
- func (self *MockContainerHandler) ContainerReference() (info.ContainerReference, error)
- func (self *MockContainerHandler) GetSpec() (info.ContainerSpec, error)
- func (self *MockContainerHandler) GetStats() (*info.ContainerStats, error)
- func (self *MockContainerHandler) ListContainers(listType ListType) ([]info.ContainerReference, error)
- func (self *MockContainerHandler) ListProcesses(listType ListType) ([]int, error)
- func (self *MockContainerHandler) ListThreads(listType ListType) ([]int, error)
- func (self *MockContainerHandler) WatchSubcontainers(events chan SubcontainerEvent) error
- type SubcontainerEvent
Constants ¶
View Source
const ( LIST_SELF = iota LIST_RECURSIVE )
Listing types.
View Source
const ( SUBCONTAINER_ADD = iota SUBCONTAINER_DELETE )
SubcontainerEvent types.
Variables ¶
This section is empty.
Functions ¶
func ClearContainerHandlerFactories ¶
func ClearContainerHandlerFactories()
Clear the known factories.
func RegisterContainerHandlerFactory ¶
func RegisterContainerHandlerFactory(factory ContainerHandlerFactory)
Register a ContainerHandlerFactory. These should be registered from least general to most general as they will be asked in order whether they can handle a particular container.
Types ¶
type ContainerHandler ¶
type ContainerHandler interface { ContainerReference() (info.ContainerReference, error) GetSpec() (info.ContainerSpec, error) GetStats() (*info.ContainerStats, error) ListContainers(listType ListType) ([]info.ContainerReference, error) ListThreads(listType ListType) ([]int, error) ListProcesses(listType ListType) ([]int, error) WatchSubcontainers(events chan SubcontainerEvent) error }
Interface for container operation handlers.
func NewContainerHandler ¶
func NewContainerHandler(name string) (ContainerHandler, error)
Create a new ContainerHandler for the specified container.
type ContainerHandlerFactory ¶
type ContainerHandlerFactory interface { // Create a new ContainerHandler using this factory. CanHandle() must have returned true. NewContainerHandler(name string) (ContainerHandler, error) // Returns whether this factory can handle the specified container. CanHandle(name string) bool // Name of the factory. String() string }
type FactoryForMockContainerHandler ¶
type FactoryForMockContainerHandler struct { Name string PrepareContainerHandlerFunc func(name string, handler *MockContainerHandler) }
func (*FactoryForMockContainerHandler) CanHandle ¶
func (self *FactoryForMockContainerHandler) CanHandle(name string) bool
func (*FactoryForMockContainerHandler) NewContainerHandler ¶
func (self *FactoryForMockContainerHandler) NewContainerHandler(name string) (ContainerHandler, error)
func (*FactoryForMockContainerHandler) String ¶
func (self *FactoryForMockContainerHandler) String() string
type MockContainerHandler ¶
This struct mocks a container handler.
func NewMockContainerHandler ¶
func NewMockContainerHandler(containerName string) *MockContainerHandler
func (*MockContainerHandler) ContainerReference ¶
func (self *MockContainerHandler) ContainerReference() (info.ContainerReference, error)
If self.Name is not empty, then ContainerReference() will return self.Name and self.Aliases. Otherwise, it will use the value provided by .On().Return().
func (*MockContainerHandler) GetSpec ¶
func (self *MockContainerHandler) GetSpec() (info.ContainerSpec, error)
func (*MockContainerHandler) GetStats ¶
func (self *MockContainerHandler) GetStats() (*info.ContainerStats, error)
func (*MockContainerHandler) ListContainers ¶
func (self *MockContainerHandler) ListContainers(listType ListType) ([]info.ContainerReference, error)
func (*MockContainerHandler) ListProcesses ¶
func (self *MockContainerHandler) ListProcesses(listType ListType) ([]int, error)
func (*MockContainerHandler) ListThreads ¶
func (self *MockContainerHandler) ListThreads(listType ListType) ([]int, error)
func (*MockContainerHandler) WatchSubcontainers ¶
func (self *MockContainerHandler) WatchSubcontainers(events chan SubcontainerEvent) error
type SubcontainerEvent ¶
Click to show internal directories.
Click to hide internal directories.