testing

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactoryForMockContainerHandler

type FactoryForMockContainerHandler struct {
	Name                        string
	PrepareContainerHandlerFunc func(name string, handler *MockContainerHandler)
}

func (*FactoryForMockContainerHandler) CanHandle

func (h *FactoryForMockContainerHandler) CanHandle(name string) bool

func (*FactoryForMockContainerHandler) NewContainerHandler

func (h *FactoryForMockContainerHandler) NewContainerHandler(name string, metadataEnvAllowList []string, inHostNamespace bool) (container.ContainerHandler, error)

func (*FactoryForMockContainerHandler) String

type MockContainerHandler

type MockContainerHandler struct {
	mock.Mock
	Name    string
	Aliases []string
}

This struct mocks a container handler.

func NewMockContainerHandler

func NewMockContainerHandler(containerName string) *MockContainerHandler

func (*MockContainerHandler) Cleanup

func (h *MockContainerHandler) Cleanup()

func (*MockContainerHandler) ContainerReference

func (h *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) Exists

func (h *MockContainerHandler) Exists() bool

func (*MockContainerHandler) GetCgroupPath

func (h *MockContainerHandler) GetCgroupPath(path string) (string, error)

func (*MockContainerHandler) GetContainerIPAddress

func (h *MockContainerHandler) GetContainerIPAddress() string

func (*MockContainerHandler) GetContainerLabels

func (h *MockContainerHandler) GetContainerLabels() map[string]string

func (*MockContainerHandler) GetSpec

func (h *MockContainerHandler) GetSpec() (info.ContainerSpec, error)

func (*MockContainerHandler) GetStats

func (h *MockContainerHandler) GetStats() (*info.ContainerStats, error)

func (*MockContainerHandler) ListContainers

func (h *MockContainerHandler) ListContainers(listType container.ListType) ([]info.ContainerReference, error)

func (*MockContainerHandler) ListProcesses

func (h *MockContainerHandler) ListProcesses(listType container.ListType) ([]int, error)

func (*MockContainerHandler) Start

func (h *MockContainerHandler) Start()

func (*MockContainerHandler) Type

Jump to

Keyboard shortcuts

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