githubwebhook

package
v0.0.0-...-353ba8c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret(k string) ([]byte, error)

GetSecret gets a secret from the mounted volume.

Types

type ClientForInstallation

type ClientForInstallation func(installationId int64) (*gh.Client, error)

ClientForInstallation creates a go-github client for a specific app installation.

type GhCliSetup

type GhCliSetup struct {
	Username      string
	CliForInstall ClientForInstallation
	CliForApp     *gh.Client
}

GhCliSetup is the return value for `SetupGhCli`.

func SetupGhCli

func SetupGhCli(ctx context.Context) (GhCliSetup, error)

SetupGhCli abstracts away the github app aspect and gives us a username to pay attention to and a way to get a GH client.

type HasInstallation

type HasInstallation interface {
	GetInstallation() *gh.Installation
}

HasInstallation covers all relevant webhook events

type RawKeyPair

type RawKeyPair struct {
	Public  []byte
	Private []byte
}

RawKeyPair can be written to disk.

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook is the state we need to handle webhook events

func NewWebhook

func NewWebhook(key []byte, events chan interface{}) Webhook

NewWebhook creates the state needed for a webhook

func (*Webhook) ServeHTTP

func (webhook *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebhookHandler

type WebhookHandler struct {
	// contains filtered or unexported fields
}

WebhookHandler handles a specific event

type WebhookWorker

type WebhookWorker struct {
	// contains filtered or unexported fields
}

WebhookWorker pulls webhook events off the chan and gives them to a WebhookHandler

func NewWebhookWorker

func NewWebhookWorker(k8s client.Client, makeGhcli ClientForInstallation, username string, log logr.Logger) WebhookWorker

NewWebhookWorker creates the state needed for a worker

func (*WebhookWorker) Worker

func (webhook *WebhookWorker) Worker(wg *sync.WaitGroup, events <-chan interface{})

Worker handles github events from a channel

Jump to

Keyboard shortcuts

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