Documentation ¶
Index ¶
- func NewFakeCNIPlugin() ocicni.CNIPlugin
- type CalledDetail
- type FakeCNIPlugin
- func (f *FakeCNIPlugin) ClearErrors()
- func (f *FakeCNIPlugin) GetCalledDetails() []CalledDetail
- func (f *FakeCNIPlugin) GetCalledNames() []string
- func (f *FakeCNIPlugin) GetPodNetworkStatus(podNetwork ocicni.PodNetwork) (string, error)
- func (f *FakeCNIPlugin) InjectError(fn string, err error)
- func (f *FakeCNIPlugin) InjectErrors(errs map[string]error)
- func (f *FakeCNIPlugin) Name() string
- func (f *FakeCNIPlugin) SetFakePodNetwork(podNetwork ocicni.PodNetwork, ip string)
- func (f *FakeCNIPlugin) SetUpPod(podNetwork ocicni.PodNetwork) error
- func (f *FakeCNIPlugin) Status() error
- func (f *FakeCNIPlugin) TearDownPod(podNetwork ocicni.PodNetwork) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeCNIPlugin ¶
NewFakeCNIPlugin create a FakeCNIPlugin.
Types ¶
type CalledDetail ¶
type CalledDetail struct { // Name of the function called. Name string // Argument of the function called. Argument interface{} }
CalledDetail is the struct contains called function name and arguments.
type FakeCNIPlugin ¶
type FakeCNIPlugin struct { sync.Mutex IPMap map[string]string // contains filtered or unexported fields }
FakeCNIPlugin is a fake plugin used for test.
func (*FakeCNIPlugin) ClearErrors ¶
func (f *FakeCNIPlugin) ClearErrors()
ClearErrors clear errors for call
func (*FakeCNIPlugin) GetCalledDetails ¶
func (f *FakeCNIPlugin) GetCalledDetails() []CalledDetail
GetCalledDetails get detail of each call.
func (*FakeCNIPlugin) GetCalledNames ¶
func (f *FakeCNIPlugin) GetCalledNames() []string
GetCalledNames get names of call
func (*FakeCNIPlugin) GetPodNetworkStatus ¶
func (f *FakeCNIPlugin) GetPodNetworkStatus(podNetwork ocicni.PodNetwork) (string, error)
GetPodNetworkStatus get the status of network.
func (*FakeCNIPlugin) InjectError ¶
func (f *FakeCNIPlugin) InjectError(fn string, err error)
InjectError inject error for call
func (*FakeCNIPlugin) InjectErrors ¶
func (f *FakeCNIPlugin) InjectErrors(errs map[string]error)
InjectErrors inject errors for calls
func (*FakeCNIPlugin) Name ¶
func (f *FakeCNIPlugin) Name() string
Name return the name of fake CNI plugin.
func (*FakeCNIPlugin) SetFakePodNetwork ¶
func (f *FakeCNIPlugin) SetFakePodNetwork(podNetwork ocicni.PodNetwork, ip string)
SetFakePodNetwork sets the given IP for given arguments.
func (*FakeCNIPlugin) SetUpPod ¶
func (f *FakeCNIPlugin) SetUpPod(podNetwork ocicni.PodNetwork) error
SetUpPod setup the network of PodSandbox.
func (*FakeCNIPlugin) Status ¶
func (f *FakeCNIPlugin) Status() error
Status get the status of the plugin.
func (*FakeCNIPlugin) TearDownPod ¶
func (f *FakeCNIPlugin) TearDownPod(podNetwork ocicni.PodNetwork) error
TearDownPod teardown the network of PodSandbox.
Click to show internal directories.
Click to hide internal directories.