Documentation ¶
Index ¶
- type MockPolicyCache
- func (mpc *MockPolicyCache) AddPodConfig(id podmodel.ID, ipAddr string, labels ...*podmodel.Pod_Label)
- func (mpc *MockPolicyCache) ListAllNamespaces() (namespaces []nsmodel.ID)
- func (mpc *MockPolicyCache) ListAllPods() (pods []podmodel.ID)
- func (mpc *MockPolicyCache) ListAllPolicies() (policies []policymodel.ID)
- func (mpc *MockPolicyCache) LookupNamespace(namespace nsmodel.ID) (found bool, data *nsmodel.Namespace)
- func (mpc *MockPolicyCache) LookupNamespacesByLabelSelector(nsLabelSelector string) (namespaces []nsmodel.ID)
- func (mpc *MockPolicyCache) LookupPod(pod podmodel.ID) (found bool, data *podmodel.Pod)
- func (mpc *MockPolicyCache) LookupPodsByLabelSelector(podLabelSelector *policymodel.Policy_LabelSelector) (pods []podmodel.ID)
- func (mpc *MockPolicyCache) LookupPodsByNSLabelSelector(namespace string, podLabelSelector *policymodel.Policy_LabelSelector) (pods []podmodel.ID)
- func (mpc *MockPolicyCache) LookupPodsByNamespace(policyNamespace string) (pods []podmodel.ID)
- func (mpc *MockPolicyCache) LookupPoliciesByPod(pod podmodel.ID) (policies []policymodel.ID)
- func (mpc *MockPolicyCache) LookupPolicy(policy policymodel.ID) (found bool, data *policymodel.Policy)
- func (mpc *MockPolicyCache) Resync(resyncEv datasync.ResyncEvent) error
- func (mpc *MockPolicyCache) Update(dataChngEv datasync.ChangeEvent) error
- func (mpc *MockPolicyCache) Watch(watcher cache.PolicyCacheWatcher) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPolicyCache ¶
type MockPolicyCache struct {
// contains filtered or unexported fields
}
MockPolicyCache is mock for PolicyCache that only provides fake implementation of LookupPod().
func NewMockPolicyCache ¶
func NewMockPolicyCache() *MockPolicyCache
NewMockPolicyCache is a constructor for MockPolicyCache.
func (*MockPolicyCache) AddPodConfig ¶
func (mpc *MockPolicyCache) AddPodConfig(id podmodel.ID, ipAddr string, labels ...*podmodel.Pod_Label)
AddPodConfig allows to fill the cache with fake pod data.
func (*MockPolicyCache) ListAllNamespaces ¶
func (mpc *MockPolicyCache) ListAllNamespaces() (namespaces []nsmodel.ID)
ListAllNamespaces is not implemented by the mock.
func (*MockPolicyCache) ListAllPods ¶
func (mpc *MockPolicyCache) ListAllPods() (pods []podmodel.ID)
ListAllPods is not implemented by the mock.
func (*MockPolicyCache) ListAllPolicies ¶
func (mpc *MockPolicyCache) ListAllPolicies() (policies []policymodel.ID)
ListAllPolicies is not implemented by the mock.
func (*MockPolicyCache) LookupNamespace ¶
func (mpc *MockPolicyCache) LookupNamespace(namespace nsmodel.ID) (found bool, data *nsmodel.Namespace)
LookupNamespace is not implemented by the mock.
func (*MockPolicyCache) LookupNamespacesByLabelSelector ¶
func (mpc *MockPolicyCache) LookupNamespacesByLabelSelector(nsLabelSelector string) (namespaces []nsmodel.ID)
LookupNamespacesByLabelSelector is not implemented by the mock.
func (*MockPolicyCache) LookupPod ¶
LookupPod return pod config previously added using AddPodConfig.
func (*MockPolicyCache) LookupPodsByLabelSelector ¶
func (mpc *MockPolicyCache) LookupPodsByLabelSelector(podLabelSelector *policymodel.Policy_LabelSelector) (pods []podmodel.ID)
LookupPodsByLabelSelector is not implemented by the mock.
func (*MockPolicyCache) LookupPodsByNSLabelSelector ¶
func (mpc *MockPolicyCache) LookupPodsByNSLabelSelector(namespace string, podLabelSelector *policymodel.Policy_LabelSelector) (pods []podmodel.ID)
LookupPodsByNSLabelSelector is not implemented by the mock.
func (*MockPolicyCache) LookupPodsByNamespace ¶
func (mpc *MockPolicyCache) LookupPodsByNamespace(policyNamespace string) (pods []podmodel.ID)
LookupPodsByNamespace is not implemented by the mock.
func (*MockPolicyCache) LookupPoliciesByPod ¶
func (mpc *MockPolicyCache) LookupPoliciesByPod(pod podmodel.ID) (policies []policymodel.ID)
LookupPoliciesByPod is not implemented by the mock.
func (*MockPolicyCache) LookupPolicy ¶
func (mpc *MockPolicyCache) LookupPolicy(policy policymodel.ID) (found bool, data *policymodel.Policy)
LookupPolicy is not implemented by the mock.
func (*MockPolicyCache) Resync ¶
func (mpc *MockPolicyCache) Resync(resyncEv datasync.ResyncEvent) error
Resync is not implemented by the mock.
func (*MockPolicyCache) Update ¶
func (mpc *MockPolicyCache) Update(dataChngEv datasync.ChangeEvent) error
Update is not implemented by the mock.
func (*MockPolicyCache) Watch ¶
func (mpc *MockPolicyCache) Watch(watcher cache.PolicyCacheWatcher) error
Watch is not implemented by the mock.