Documentation ¶
Index ¶
- func IsMockError(err error) bool
- type Container
- type Sandbox
- func (s *Sandbox) AddDevice(info config.DeviceInfo) (api.Device, error)
- func (s *Sandbox) AddInterface(inf *vcTypes.Interface) (*vcTypes.Interface, error)
- func (s *Sandbox) Annotations(key string) (string, error)
- func (s *Sandbox) CreateContainer(conf vc.ContainerConfig) (vc.VCContainer, error)
- func (s *Sandbox) Delete() error
- func (s *Sandbox) DeleteContainer(contID string) (vc.VCContainer, error)
- func (s *Sandbox) EnterContainer(containerID string, cmd types.Cmd) (vc.VCContainer, *vc.Process, error)
- func (s *Sandbox) GetAllContainers() []vc.VCContainer
- func (s *Sandbox) GetAnnotations() map[string]string
- func (s *Sandbox) GetContainer(containerID string) vc.VCContainer
- func (s *Sandbox) GetNetNs() string
- func (s *Sandbox) GetOOMEvent() (string, error)
- func (s *Sandbox) ID() string
- func (s *Sandbox) IOStream(containerID, processID string) (io.WriteCloser, io.Reader, io.Reader, error)
- func (s *Sandbox) KillContainer(contID string, signal syscall.Signal, all bool) error
- func (s *Sandbox) ListInterfaces() ([]*vcTypes.Interface, error)
- func (s *Sandbox) ListRoutes() ([]*vcTypes.Route, error)
- func (s *Sandbox) Monitor() (chan error, error)
- func (s *Sandbox) Pause() error
- func (s *Sandbox) PauseContainer(contID string) error
- func (s *Sandbox) ProcessListContainer(containerID string, options vc.ProcessListOptions) (vc.ProcessList, error)
- func (s *Sandbox) Release() error
- func (s *Sandbox) RemoveInterface(inf *vcTypes.Interface) (*vcTypes.Interface, error)
- func (s *Sandbox) Resume() error
- func (s *Sandbox) ResumeContainer(contID string) error
- func (s *Sandbox) SetAnnotations(annotations map[string]string) error
- func (s *Sandbox) SignalProcess(containerID, processID string, signal syscall.Signal, all bool) error
- func (s *Sandbox) Start() error
- func (s *Sandbox) StartContainer(contID string) (vc.VCContainer, error)
- func (s *Sandbox) StatsContainer(contID string) (vc.ContainerStats, error)
- func (s *Sandbox) Status() vc.SandboxStatus
- func (s *Sandbox) StatusContainer(contID string) (vc.ContainerStatus, error)
- func (s *Sandbox) Stop(force bool) error
- func (s *Sandbox) StopContainer(contID string, force bool) (vc.VCContainer, error)
- func (s *Sandbox) UpdateContainer(containerID string, resources specs.LinuxResources) error
- func (s *Sandbox) UpdateRoutes(routes []*vcTypes.Route) ([]*vcTypes.Route, error)
- func (s *Sandbox) WaitProcess(containerID, processID string) (int32, error)
- func (s *Sandbox) WinsizeProcess(containerID, processID string, height, width uint32) error
- type VCMock
- func (m *VCMock) AddDevice(ctx context.Context, sandboxID string, info config.DeviceInfo) (api.Device, error)
- func (m *VCMock) AddInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error)
- func (m *VCMock) CleanupContainer(ctx context.Context, sandboxID, containerID string, force bool) error
- func (m *VCMock) CreateContainer(ctx context.Context, sandboxID string, containerConfig vc.ContainerConfig) (vc.VCSandbox, vc.VCContainer, error)
- func (m *VCMock) CreateSandbox(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error)
- func (m *VCMock) DeleteContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
- func (m *VCMock) DeleteSandbox(ctx context.Context, sandboxID string) (vc.VCSandbox, error)
- func (m *VCMock) EnterContainer(ctx context.Context, sandboxID, containerID string, cmd types.Cmd) (vc.VCSandbox, vc.VCContainer, *vc.Process, error)
- func (m *VCMock) FetchSandbox(ctx context.Context, sandboxID string) (vc.VCSandbox, error)
- func (m *VCMock) KillContainer(ctx context.Context, sandboxID, containerID string, signal syscall.Signal, ...) error
- func (m *VCMock) ListInterfaces(ctx context.Context, sandboxID string) ([]*vcTypes.Interface, error)
- func (m *VCMock) ListRoutes(ctx context.Context, sandboxID string) ([]*vcTypes.Route, error)
- func (m *VCMock) ListSandbox(ctx context.Context) ([]vc.SandboxStatus, error)
- func (m *VCMock) PauseContainer(ctx context.Context, sandboxID, containerID string) error
- func (m *VCMock) ProcessListContainer(ctx context.Context, sandboxID, containerID string, ...) (vc.ProcessList, error)
- func (m *VCMock) RemoveInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error)
- func (m *VCMock) ResumeContainer(ctx context.Context, sandboxID, containerID string) error
- func (m *VCMock) RunSandbox(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error)
- func (m *VCMock) SetFactory(ctx context.Context, factory vc.Factory)
- func (m *VCMock) SetLogger(ctx context.Context, logger *logrus.Entry)
- func (m *VCMock) StartContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
- func (m *VCMock) StartSandbox(ctx context.Context, sandboxID string) (vc.VCSandbox, error)
- func (m *VCMock) StatsContainer(ctx context.Context, sandboxID, containerID string) (vc.ContainerStats, error)
- func (m *VCMock) StatsSandbox(ctx context.Context, sandboxID string) (vc.SandboxStats, []vc.ContainerStats, error)
- func (m *VCMock) StatusContainer(ctx context.Context, sandboxID, containerID string) (vc.ContainerStatus, error)
- func (m *VCMock) StatusSandbox(ctx context.Context, sandboxID string) (vc.SandboxStatus, error)
- func (m *VCMock) StopContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
- func (m *VCMock) StopSandbox(ctx context.Context, sandboxID string, force bool) (vc.VCSandbox, error)
- func (m *VCMock) UpdateContainer(ctx context.Context, sandboxID, containerID string, ...) error
- func (m *VCMock) UpdateRoutes(ctx context.Context, sandboxID string, routes []*vcTypes.Route) ([]*vcTypes.Route, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMockError ¶
IsMockError returns true if the specified error was generated by this package.
Types ¶
type Container ¶
type Container struct { MockID string MockURL string MockToken string MockProcess vc.Process MockPid int MockSandbox *Sandbox MockAnnotations map[string]string }
Container is a fake Container type used for testing
func (*Container) GetAnnotations ¶
GetAnnotations implements the VCContainer function of the same name.
type Sandbox ¶
type Sandbox struct { MockID string MockURL string MockAnnotations map[string]string MockContainers []*Container MockNetNs string }
Sandbox is a fake Sandbox type used for testing
func (*Sandbox) AddInterface ¶
AddInterface implements the VCSandbox function of the same name.
func (*Sandbox) Annotations ¶
Annotations implements the VCSandbox function of the same name.
func (*Sandbox) CreateContainer ¶
func (s *Sandbox) CreateContainer(conf vc.ContainerConfig) (vc.VCContainer, error)
CreateContainer implements the VCSandbox function of the same name.
func (*Sandbox) DeleteContainer ¶
func (s *Sandbox) DeleteContainer(contID string) (vc.VCContainer, error)
DeleteContainer implements the VCSandbox function of the same name.
func (*Sandbox) EnterContainer ¶
func (s *Sandbox) EnterContainer(containerID string, cmd types.Cmd) (vc.VCContainer, *vc.Process, error)
EnterContainer implements the VCSandbox function of the same name.
func (*Sandbox) GetAllContainers ¶
func (s *Sandbox) GetAllContainers() []vc.VCContainer
GetAllContainers implements the VCSandbox function of the same name.
func (*Sandbox) GetAnnotations ¶
GetAnnotations implements the VCSandbox function of the same name.
func (*Sandbox) GetContainer ¶
func (s *Sandbox) GetContainer(containerID string) vc.VCContainer
GetContainer implements the VCSandbox function of the same name.
func (*Sandbox) GetOOMEvent ¶
func (*Sandbox) IOStream ¶
func (s *Sandbox) IOStream(containerID, processID string) (io.WriteCloser, io.Reader, io.Reader, error)
IOStream implements the VCSandbox function of the same name.
func (*Sandbox) KillContainer ¶
KillContainer implements the VCSandbox function of the same name.
func (*Sandbox) ListInterfaces ¶
ListInterfaces implements the VCSandbox function of the same name.
func (*Sandbox) ListRoutes ¶
ListRoutes implements the VCSandbox function of the same name.
func (*Sandbox) PauseContainer ¶
PauseContainer implements the VCSandbox function of the same name.
func (*Sandbox) ProcessListContainer ¶
func (s *Sandbox) ProcessListContainer(containerID string, options vc.ProcessListOptions) (vc.ProcessList, error)
ProcessListContainer implements the VCSandbox function of the same name.
func (*Sandbox) RemoveInterface ¶
RemoveInterface implements the VCSandbox function of the same name.
func (*Sandbox) ResumeContainer ¶
ResumeContainer implements the VCSandbox function of the same name.
func (*Sandbox) SetAnnotations ¶
SetAnnotations implements the VCSandbox function of the same name.
func (*Sandbox) SignalProcess ¶
func (s *Sandbox) SignalProcess(containerID, processID string, signal syscall.Signal, all bool) error
SignalProcess implements the VCSandbox function of the same name.
func (*Sandbox) StartContainer ¶
func (s *Sandbox) StartContainer(contID string) (vc.VCContainer, error)
StartContainer implements the VCSandbox function of the same name.
func (*Sandbox) StatsContainer ¶
func (s *Sandbox) StatsContainer(contID string) (vc.ContainerStats, error)
StatsContainer implements the VCSandbox function of the same name.
func (*Sandbox) Status ¶
func (s *Sandbox) Status() vc.SandboxStatus
Status implements the VCSandbox function of the same name.
func (*Sandbox) StatusContainer ¶
func (s *Sandbox) StatusContainer(contID string) (vc.ContainerStatus, error)
StatusContainer implements the VCSandbox function of the same name.
func (*Sandbox) StopContainer ¶
StopContainer implements the VCSandbox function of the same name.
func (*Sandbox) UpdateContainer ¶
func (s *Sandbox) UpdateContainer(containerID string, resources specs.LinuxResources) error
UpdateContainer implements the VCSandbox function of the same name.
func (*Sandbox) UpdateRoutes ¶
UpdateRoutes implements the VCSandbox function of the same name.
func (*Sandbox) WaitProcess ¶
WaitProcess implements the VCSandbox function of the same name.
type VCMock ¶
type VCMock struct { SetLoggerFunc func(ctx context.Context, logger *logrus.Entry) SetFactoryFunc func(ctx context.Context, factory vc.Factory) CreateSandboxFunc func(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) DeleteSandboxFunc func(ctx context.Context, sandboxID string) (vc.VCSandbox, error) ListSandboxFunc func(ctx context.Context) ([]vc.SandboxStatus, error) FetchSandboxFunc func(ctx context.Context, sandboxID string) (vc.VCSandbox, error) RunSandboxFunc func(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) StartSandboxFunc func(ctx context.Context, sandboxID string) (vc.VCSandbox, error) StatusSandboxFunc func(ctx context.Context, sandboxID string) (vc.SandboxStatus, error) StatsContainerFunc func(ctx context.Context, sandboxID, containerID string) (vc.ContainerStats, error) StatsSandboxFunc func(ctx context.Context, sandboxID string) (vc.SandboxStats, []vc.ContainerStats, error) StopSandboxFunc func(ctx context.Context, sandboxID string, force bool) (vc.VCSandbox, error) CreateContainerFunc func(ctx context.Context, sandboxID string, containerConfig vc.ContainerConfig) (vc.VCSandbox, vc.VCContainer, error) DeleteContainerFunc func(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error) EnterContainerFunc func(ctx context.Context, sandboxID, containerID string, cmd types.Cmd) (vc.VCSandbox, vc.VCContainer, *vc.Process, error) KillContainerFunc func(ctx context.Context, sandboxID, containerID string, signal syscall.Signal, all bool) error StartContainerFunc func(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error) StatusContainerFunc func(ctx context.Context, sandboxID, containerID string) (vc.ContainerStatus, error) StopContainerFunc func(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error) ProcessListContainerFunc func(ctx context.Context, sandboxID, containerID string, options vc.ProcessListOptions) (vc.ProcessList, error) UpdateContainerFunc func(ctx context.Context, sandboxID, containerID string, resources specs.LinuxResources) error PauseContainerFunc func(ctx context.Context, sandboxID, containerID string) error ResumeContainerFunc func(ctx context.Context, sandboxID, containerID string) error AddDeviceFunc func(ctx context.Context, sandboxID string, info config.DeviceInfo) (api.Device, error) AddInterfaceFunc func(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) RemoveInterfaceFunc func(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) ListInterfacesFunc func(ctx context.Context, sandboxID string) ([]*vcTypes.Interface, error) UpdateRoutesFunc func(ctx context.Context, sandboxID string, routes []*vcTypes.Route) ([]*vcTypes.Route, error) ListRoutesFunc func(ctx context.Context, sandboxID string) ([]*vcTypes.Route, error) CleanupContainerFunc func(ctx context.Context, sandboxID, containerID string, force bool) error }
VCMock is a type that provides an implementation of the VC interface. It is used for testing.
func (*VCMock) AddDevice ¶
func (m *VCMock) AddDevice(ctx context.Context, sandboxID string, info config.DeviceInfo) (api.Device, error)
AddDevice implements the VC function of the same name.
func (*VCMock) AddInterface ¶
func (m *VCMock) AddInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error)
AddInterface implements the VC function of the same name.
func (*VCMock) CleanupContainer ¶
func (*VCMock) CreateContainer ¶
func (m *VCMock) CreateContainer(ctx context.Context, sandboxID string, containerConfig vc.ContainerConfig) (vc.VCSandbox, vc.VCContainer, error)
CreateContainer implements the VC function of the same name.
func (*VCMock) CreateSandbox ¶
func (m *VCMock) CreateSandbox(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error)
CreateSandbox implements the VC function of the same name.
func (*VCMock) DeleteContainer ¶
func (m *VCMock) DeleteContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
DeleteContainer implements the VC function of the same name.
func (*VCMock) DeleteSandbox ¶
DeleteSandbox implements the VC function of the same name.
func (*VCMock) EnterContainer ¶
func (m *VCMock) EnterContainer(ctx context.Context, sandboxID, containerID string, cmd types.Cmd) (vc.VCSandbox, vc.VCContainer, *vc.Process, error)
EnterContainer implements the VC function of the same name.
func (*VCMock) FetchSandbox ¶
FetchSandbox implements the VC function of the same name.
func (*VCMock) KillContainer ¶
func (m *VCMock) KillContainer(ctx context.Context, sandboxID, containerID string, signal syscall.Signal, all bool) error
KillContainer implements the VC function of the same name.
func (*VCMock) ListInterfaces ¶
func (m *VCMock) ListInterfaces(ctx context.Context, sandboxID string) ([]*vcTypes.Interface, error)
ListInterfaces implements the VC function of the same name.
func (*VCMock) ListRoutes ¶
ListRoutes implements the VC function of the same name.
func (*VCMock) ListSandbox ¶
ListSandbox implements the VC function of the same name.
func (*VCMock) PauseContainer ¶
PauseContainer implements the VC function of the same name.
func (*VCMock) ProcessListContainer ¶
func (m *VCMock) ProcessListContainer(ctx context.Context, sandboxID, containerID string, options vc.ProcessListOptions) (vc.ProcessList, error)
ProcessListContainer implements the VC function of the same name.
func (*VCMock) RemoveInterface ¶
func (m *VCMock) RemoveInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error)
RemoveInterface implements the VC function of the same name.
func (*VCMock) ResumeContainer ¶
ResumeContainer implements the VC function of the same name.
func (*VCMock) RunSandbox ¶
func (m *VCMock) RunSandbox(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error)
RunSandbox implements the VC function of the same name.
func (*VCMock) SetFactory ¶
SetFactory implements the VC function of the same name.
func (*VCMock) StartContainer ¶
func (m *VCMock) StartContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
StartContainer implements the VC function of the same name.
func (*VCMock) StartSandbox ¶
StartSandbox implements the VC function of the same name.
func (*VCMock) StatsContainer ¶
func (m *VCMock) StatsContainer(ctx context.Context, sandboxID, containerID string) (vc.ContainerStats, error)
StatsContainer implements the VC function of the same name.
func (*VCMock) StatsSandbox ¶
func (m *VCMock) StatsSandbox(ctx context.Context, sandboxID string) (vc.SandboxStats, []vc.ContainerStats, error)
StatsSandbox implements the VC function of the same name.
func (*VCMock) StatusContainer ¶
func (m *VCMock) StatusContainer(ctx context.Context, sandboxID, containerID string) (vc.ContainerStatus, error)
StatusContainer implements the VC function of the same name.
func (*VCMock) StatusSandbox ¶
StatusSandbox implements the VC function of the same name.
func (*VCMock) StopContainer ¶
func (m *VCMock) StopContainer(ctx context.Context, sandboxID, containerID string) (vc.VCContainer, error)
StopContainer implements the VC function of the same name.
func (*VCMock) StopSandbox ¶
func (m *VCMock) StopSandbox(ctx context.Context, sandboxID string, force bool) (vc.VCSandbox, error)
StopSandbox implements the VC function of the same name.
func (*VCMock) UpdateContainer ¶
func (m *VCMock) UpdateContainer(ctx context.Context, sandboxID, containerID string, resources specs.LinuxResources) error
UpdateContainer implements the VC function of the same name.