Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when object is not found in index. ErrNotFound = fmt.Errorf("not found") )
Functions ¶
This section is empty.
Types ¶
type ContainerIndex ¶
type ContainerIndex struct {
// contains filtered or unexported fields
}
ContainerIndex provides a convenient and thread-safe way for storing containers.
func NewContainerIndex ¶
func NewContainerIndex() *ContainerIndex
NewContainerIndex returns new ContainerIndex ready to use.
func (*ContainerIndex) Add ¶
func (i *ContainerIndex) Add(cont *kube.Container) error
Add adds the given container. If container already exists it returns an error.
func (*ContainerIndex) Find ¶
func (i *ContainerIndex) Find(id string) (*kube.Container, error)
Find searches for container by its ID or prefix. This method may return error if prefix is not long enough to identify container uniquely.
func (*ContainerIndex) Iterate ¶
func (i *ContainerIndex) Iterate(handler func(*kube.Container))
Iterate calls handler func on each container registered in index.
func (*ContainerIndex) Remove ¶
func (i *ContainerIndex) Remove(id string) error
Remove removes container from index if it present or does nothing otherwise.
type ImageIndex ¶
type ImageIndex struct {
// contains filtered or unexported fields
}
ImageIndex provides a convenient and thread-safe way for storing images.
func NewImageIndex ¶
func NewImageIndex() *ImageIndex
NewImageIndex returns new ImageIndex ready to use.
func (*ImageIndex) Add ¶
func (i *ImageIndex) Add(image *image.Info) error
Add adds the given image info to the index. If image with the same ID already exists it updates old image info appropriately.
func (*ImageIndex) Find ¶
func (i *ImageIndex) Find(id string) (*image.Info, error)
Find searches for expectImage info by its ID or prefix or any of tags. This method may return error if prefix is not long enough to identify expectImage uniquely. If image is not found ErrNotFound is returned.
func (*ImageIndex) Iterate ¶
func (i *ImageIndex) Iterate(handler func(image *image.Info))
Iterate calls handler func on each pod registered in index.
func (*ImageIndex) Remove ¶
func (i *ImageIndex) Remove(id string) error
Remove removes pod from index if it present or returns otherwise.
type PodIndex ¶
type PodIndex struct {
// contains filtered or unexported fields
}
PodIndex provides a convenient and thread-safe way for storing pods.
func (*PodIndex) Find ¶
Find searches for pod by its ID or prefix. This method may return error if prefix is not long enough to identify pod uniquely.