endpoints

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigMapName = "githubwebhook"

ConfigMapName ... the name of the ConfigMap to create

Variables

View Source
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

func RespondError(response *restful.Response, err error, statusCode int)

RespondError ...

func RespondErrorAndMessage

func RespondErrorAndMessage(response *restful.Response, err error, message string, statusCode int)

RespondErrorAndMessage ...

func RespondErrorMessage

func RespondErrorMessage(response *restful.Response, message string, statusCode int)

RespondErrorMessage ...

Types

type EnvDefaults

type EnvDefaults struct {
	Namespace      string `json:"namespace"`
	DockerRegistry string `json:"dockerregistry"`
	CallbackURL    string `json:"endpointurl"`
}

type GitHub

type GitHub struct {
	Client    *github.Client
	Context   context.Context
	Org       string
	Repo      string
	SSLVerify bool
	Resource  Resource
}

func (GitHub) AddWebhook

func (gh GitHub) AddWebhook(hook webhook) error

func (GitHub) DeleteWebhook

func (gh GitHub) DeleteWebhook(hook GitWebhook) error

func (GitHub) GetAllWebhooks

func (gh GitHub) GetAllWebhooks() ([]GitWebhook, error)

type GitHubWebhook

type GitHubWebhook struct {
	Hook *github.Hook
}

func (GitHubWebhook) GetID

func (ghWebhook GitHubWebhook) GetID() int

func (GitHubWebhook) GetURL

func (ghWebhook GitHubWebhook) GetURL() string

type GitLab

type GitLab struct {
	Client    *gitlab.Client
	ProjectID string
	SSLVerify bool
	Resource  Resource
}

func (GitLab) AddWebhook

func (gl GitLab) AddWebhook(hook webhook) error

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 GitWebhook interface {
	GetURL() string
	GetID() int
}

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

func NewResource() (Resource, error)

NewResource returns a new Resource instantiated with its clientsets

func (Resource) AddWebhook

func (r Resource) AddWebhook(hook webhook, org, repo string) (err error)

AddWebhook : attempts to add a webhook

func (Resource) RegisterExtensionWebService

func (r Resource) RegisterExtensionWebService(container *restful.Container)

RegisterExtensionWebService registers the webhook webservice

func (Resource) RegisterLivenessWebService

func (r Resource) RegisterLivenessWebService(container *restful.Container)

RegisterLivenessWebService registers the liveness web service

func (Resource) RegisterReadinessWebService

func (r Resource) RegisterReadinessWebService(container *restful.Container)

RegisterReadinessWebService registers the readiness web service

func (Resource) RegisterWeb

func (r Resource) RegisterWeb(container *restful.Container)

RegisterWeb registers extension web bundle on the container

func (Resource) RemoveWebhook

func (r Resource) RemoveWebhook(hook webhook, org, repo string) (err error)

RemoveWebhook : attempts to remove a webhook from the project

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL