{"modulePath":"github.com/fluid-cloudnative/fluid","version":"v1.0.8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Types\n\n```go\ntype HandlerFactory = func(client client.Client, args string) (MutatingHandler, error)\n```\nHandlerFactory is a function that builds a MutatingHandler.\n\n```go\ntype MutatingHandler interface {\n\t// Mutate injects affinity info into pod\n\t// if a plugin return true, it means that no need to call other plugins\n\t// map[string]base.RuntimeInfoInterface's key is pvcName\n\tMutate(*corev1.Pod, map[string]base.RuntimeInfoInterface) (shouldStop bool, err error)\n\t// GetName returns the name of plugin\n\tGetName() string\n}\n```\nMutatingHandler defines the interface for mutating a pod, implementations should be thread(goroutine) safe.\n\n```go\ntype Registry map[string]HandlerFactory\n```\n\n```go\nfunc (r Registry) Register(name string, factory HandlerFactory) error\n```\n\n```go\ntype RegistryHandler interface {\n\tGetPodWithoutDatasetHandler() []MutatingHandler\n\tGetPodWithDatasetHandler() []MutatingHandler\n\tGetServerlessPodWithDatasetHandler() []MutatingHandler\n\tGetServerlessPodWithoutDatasetHandler() []MutatingHandler\n}\n```\nRegistryHandler record the active plugins including two kinds: plugins for pod with no dataset mounted and with dataset mounted\n\n","path":"github.com/fluid-cloudnative/fluid/pkg/webhook/plugins/api","name":"api","synopsis":"","isRedistributable":true}
