{"modulePath":"github.com/cloudzero/cloudzero-agent","version":"v1.3.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package hook\n\nPackage hook contains structures and interfaces for implementing admission webhooks handlers.\n\n## Functions\n\n```go\nfunc AllowAlways(_ context.Context, _ *types.AdmissionReview, _ metav1.Object) (*types.AdmissionResponse, error)\n```\nAllowAlways is a trivial AdmitFunc that always allows the admission request. This is useful for implementing fail-open webhook behavior.\n\n## Types\n\n```go\ntype AdmitFunc func(ctx context.Context, r *types.AdmissionReview, obj metav1.Object) (*types.AdmissionResponse, error)\n```\nAdmitFunc defines how to process an admission request\n\n```go\ntype Handler struct {\n\tAccessor      config.ConfigAccessor\n\tObjectCreator types.ObjectCreator\n\tObjectType    metav1.Object\n\tCreate        AdmitFunc\n\tDelete        AdmitFunc\n\tUpdate        AdmitFunc\n\tConnect       AdmitFunc\n\tStore         types.ResourceStore\n}\n```\nHandler represents the set of functions for each operation in an admission webhook.\n\n```go\nfunc (h *Handler) Execute(ctx context.Context, r *types.AdmissionReview) (*types.AdmissionResponse, error)\n```\nExecute evaluates the request and try to execute the function for operation specified in the request.\n\n","path":"github.com/cloudzero/cloudzero-agent/app/domain/webhook/hook","name":"hook","synopsis":"Package hook contains structures and interfaces for implementing admission webhooks handlers.","isRedistributable":true}
