{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package webhook\n\nPackage webhook contains code for managing and serving webhook services, providing post push events to trigger builds.\n\n## Constants\n\n```go\nconst (\n\tDefaultConfigRef = \"master\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrSecretMismatch  = errors.New(\"the provided secret does not match\")\n\tErrHookNotEnabled  = errors.New(\"the specified hook is not enabled\")\n\tMethodNotSupported = errors.New(\"unsupported HTTP method\")\n)\n```\n\n## Functions\n\n```go\nfunc CheckSecret(namespace, userSecret string, triggers []*buildv1.WebHookTrigger, secretsClient kubernetes.SecretsGetter) (*buildv1.WebHookTrigger, error)\n```\nCheckSecret tests the user provided secret against the secrets for the webhook triggers, if a match is found then the corresponding webhook trigger is returned.\n\n```go\nfunc GenerateBuildTriggerInfo(revision *buildv1.SourceRevision, hookType string) (buildTriggerCauses []buildv1.BuildTriggerCause)\n```\n\n```go\nfunc GitRefMatches(eventRef, configRef string, buildSource *buildv1.BuildSource) bool\n```\nGitRefMatches determines if the ref from a webhook event matches a build configuration\n\n```go\nfunc NewWarning(message string) *kerrors.StatusError\n```\nNewWarning returns an StatusError object with a http.StatusOK (200) code.\n\n## Types\n\n```go\ntype Plugin interface {\n\t// Method extracts build information and returns:\n\t// - newly created build object or nil if default is to be created\n\t// - information whether to trigger the build itself\n\t// - eventual error.\n\tExtract(buildCfg *buildv1.BuildConfig, trigger *buildv1.WebHookTrigger, req *http.Request) (*buildv1.SourceRevision, []corev1.EnvVar, *buildv1.DockerStrategyOptions, bool, error)\n\tGetTriggers(buildConfig *buildv1.BuildConfig) ([]*buildv1.WebHookTrigger, error)\n}\n```\nPlugin for Webhook verification is dependent on the sending side, it can be eg. github, bitbucket or else, so there must be a separate Plugin instance for each webhook provider.\n\n","path":"github.com/2lambda123/openshift-origin/pkg/build/webhook","name":"webhook","synopsis":"Package webhook contains code for managing and serving webhook services, providing post push events to trigger builds.","isRedistributable":true}
