Documentation ¶
Index ¶
- Constants
- Variables
- func RespondError(response *restful.Response, err error, statusCode int)
- func RespondErrorAndMessage(response *restful.Response, err error, message string, statusCode int)
- func RespondErrorMessage(response *restful.Response, message string, statusCode int)
- type EnvDefaults
- type GitHub
- type GitHubWebhook
- type GitLab
- type GitLabWebhook
- type GitProvider
- type GitWebhook
- type Resource
- func (r Resource) AddWebhook(hook webhook, org, repo string) (err error)
- func (r Resource) RegisterExtensionWebService(container *restful.Container)
- func (r Resource) RegisterLivenessWebService(container *restful.Container)
- func (r Resource) RegisterReadinessWebService(container *restful.Container)
- func (r Resource) RegisterWeb(container *restful.Container)
- func (r Resource) RemoveWebhook(hook webhook, org, repo string) (err error)
Constants ¶
const ConfigMapName = "githubwebhook"
ConfigMapName ... the name of the ConfigMap to create
Variables ¶
var GetTriggerBindingObjectMeta = func(name string) metav1.ObjectMeta { return metav1.ObjectMeta{ GenerateName: "wext-" + name + "-", } }
This is deliberately written as a function such that unittests can override and set the name of artifacts for creation due to limitation of k8s GenerateName
Functions ¶
func RespondError ¶
RespondError ...
func RespondErrorAndMessage ¶
RespondErrorAndMessage ...
Types ¶
type EnvDefaults ¶
type GitHub ¶
type GitHub struct { Client *github.Client Context context.Context Org string Repo string SSLVerify bool Resource Resource }
func (GitHub) AddWebhook ¶
func (GitHub) DeleteWebhook ¶
func (gh GitHub) DeleteWebhook(hook GitWebhook) error
func (GitHub) GetAllWebhooks ¶
func (gh GitHub) GetAllWebhooks() ([]GitWebhook, error)
type GitHubWebhook ¶
func (GitHubWebhook) GetID ¶
func (ghWebhook GitHubWebhook) GetID() int
func (GitHubWebhook) GetURL ¶
func (ghWebhook GitHubWebhook) GetURL() string
type GitLab ¶
func (GitLab) AddWebhook ¶
func (GitLab) DeleteWebhook ¶
func (gl GitLab) DeleteWebhook(hook GitWebhook) error
func (GitLab) GetAllWebhooks ¶
func (gl GitLab) GetAllWebhooks() ([]GitWebhook, error)
type GitLabWebhook ¶
type GitLabWebhook struct {
Hook *gitlab.ProjectHook
}
func (GitLabWebhook) GetID ¶
func (glWebhook GitLabWebhook) GetID() int
GitLab Webhook --------------------------------------------------------------------------------------------------------
func (GitLabWebhook) GetURL ¶
func (glWebhook GitLabWebhook) GetURL() string
type GitProvider ¶
type GitProvider interface { AddWebhook(hook webhook) error DeleteWebhook(hook GitWebhook) error GetAllWebhooks() ([]GitWebhook, error) }
type GitWebhook ¶
type Resource ¶
type Resource struct { TektonClient tektoncdclientset.Interface K8sClient k8sclientset.Interface TriggersClient triggersclientset.Interface RoutesClient routeclientset.Interface Defaults EnvDefaults }
Resource stores all types here that are reused throughout files
func NewResource ¶
NewResource returns a new Resource instantiated with its clientsets
func (Resource) AddWebhook ¶
AddWebhook : attempts to add a webhook
func (Resource) RegisterExtensionWebService ¶
RegisterExtensionWebService registers the webhook webservice
func (Resource) RegisterLivenessWebService ¶
RegisterLivenessWebService registers the liveness web service
func (Resource) RegisterReadinessWebService ¶
RegisterReadinessWebService registers the readiness web service
func (Resource) RegisterWeb ¶
RegisterWeb registers extension web bundle on the container
func (Resource) RemoveWebhook ¶
RemoveWebhook : attempts to remove a webhook from the project