github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/monitor/extractors/interface.go (about) 1 package extractors 2 3 import ( 4 "context" 5 6 "go.aporeto.io/enforcerd/trireme-lib/common" 7 "go.aporeto.io/enforcerd/trireme-lib/policy" 8 9 corev1 "k8s.io/api/core/v1" 10 ) 11 12 // EventMetadataExtractor is a function used to extract a *policy.PURuntime from a given 13 // EventInfo. The EventInfo is generic and is provided over the RPC interface 14 type EventMetadataExtractor func(*common.EventInfo) (*policy.PURuntime, error) 15 16 // PodMetadataExtractor is a function used to extract a *policy.PURuntime from a given 17 // Kubernetes pod. It can furthermore extract more information using the client. 18 // The 5th argument (bool) indicates if a network namespace should get extracted 19 type PodMetadataExtractor func(context.Context, *corev1.Pod, string) (*policy.PURuntime, error) 20 21 // PodPidsSetMaxProcsProgrammer is a function used to program the pids cgroup of a pod for Trireme. 22 type PodPidsSetMaxProcsProgrammer func(ctx context.Context, pod *corev1.Pod, maxProcs int) error