Documentation ¶
Overview ¶
Package webhook contains code for managing and serving webhook services, providing post push events to trigger builds.
Index ¶
- Variables
- func FindTriggerPolicy(triggerType api.BuildTriggerType, config *api.BuildConfig) (*api.BuildTriggerPolicy, bool)
- func GitRefMatches(eventRef, configRef string) bool
- func NewController(bcg buildclient.BuildConfigGetter, bci buildclient.BuildConfigInstantiator, ...) http.Handler
- type Plugin
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSecretMismatch = fmt.Errorf("the provided secret does not match") ErrHookNotEnabled = fmt.Errorf("the specified hook is not enabled") )
Functions ¶
func FindTriggerPolicy ¶ added in v0.2.1
func FindTriggerPolicy(triggerType api.BuildTriggerType, config *api.BuildConfig) (*api.BuildTriggerPolicy, bool)
FindTriggerPolicy retrieves the BuildTrigger of a given type from a build configuration
func GitRefMatches ¶ added in v0.2.1
GitRefMatches determines if the ref from a webhook event matches a build configuration
func NewController ¶
func NewController(bcg buildclient.BuildConfigGetter, bci buildclient.BuildConfigInstantiator, plugins map[string]Plugin) http.Handler
NewController creates new webhook controller and feed it with provided plugins.
Types ¶
type Plugin ¶
type Plugin interface { // Method extracts build information and returns: // - newly created build object or nil if default is to be created // - information whether to trigger the build itself // - eventual error. Extract(buildCfg *buildapi.BuildConfig, secret, path string, req *http.Request) (*buildapi.SourceRevision, bool, error) }
Plugin 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.
Directories ¶
Path | Synopsis |
---|---|
Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage
|
Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage |
Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/
|
Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/ |
Click to show internal directories.
Click to hide internal directories.