{"modulePath":"github.com/cloudzero/cloudzero-agent","version":"v1.1.0-rc-1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package hook\n\nPackage hook contains structures and interfaces for implementing admission webhooks handlers.\n\n## Types\n\n```go\ntype AdmitFunc func(ctx context.Context, r *Request) (*Result, error)\n```\nAdmitFunc defines how to process an admission request\n\n```go\ntype Handler struct {\n\tCreate    AdmitFunc\n\tDelete    AdmitFunc\n\tUpdate    AdmitFunc\n\tConnect   AdmitFunc\n\tErrorChan chan\u003c- error\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 *Request) (*Result, error)\n```\nExecute evaluates the request and try to execute the function for operation specified in the request.\n\n```go\ntype Request = v1.AdmissionRequest\n```\n\n```go\ntype Result struct {\n\tAllowed bool\n\tMsg     string\n}\n```\nResult contains the result of an admission request\n\n","path":"github.com/cloudzero/cloudzero-agent/app/http/hook","name":"hook","synopsis":"Package hook contains structures and interfaces for implementing admission webhooks handlers.","isRedistributable":true}
