index

package
v1.0.0-beta.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewPodIndex

func NewPodIndex() *PodIndex

NewPodIndex returns new PodIndex ready to use.

func (*PodIndex) Add

func (i *PodIndex) Add(pod *kube.Pod) error

Add adds the given pod. If pod already exists it returns an error.

func (*PodIndex) Find

func (i *PodIndex) Find(id string) (*kube.Pod, error)

Find searches for pod by its ID or prefix. This method may return error if prefix is not long enough to identify pod uniquely.

func (*PodIndex) Iterate

func (i *PodIndex) Iterate(handler func(*kube.Pod))

Iterate calls handler func on each pod registered in index.

func (*PodIndex) Remove

func (i *PodIndex) Remove(id string) error

Remove removes pod from index if it present or returns otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL