pkg

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DDEV-Live bot message marker
	MessageMarker = "<!-- ddev-live bot -->"

	// Ping/pong
	Ping = "/ddev-live-ping"

	// Print help message for users calling the command
	Help = "/ddev-live-help"

	// Print help message on PR open, only when applicable
	HelpOnPROpen = "/ddev-live-help-on-pr-open"

	// Create preview site
	PreviewSite = "/ddev-live-preview-site"

	// Delete preview site, always provides verbose response event when no site exists
	DeletePreviewSite = "/ddev-live-delete-preview-site"

	// Close preview site, provides output only in case a preview site existed. This is for PR closing.
	ClosePreviewSite = "/ddev-live-close-preview-site"
)

These strings contain supported `/ddev-live-*` commands in PR/MR comments

Variables

This section is empty.

Functions

func IsBotMessage added in v0.0.5

func IsBotMessage(msg string) bool

func RepoURLNormalize added in v0.0.5

func RepoURLNormalize(url string) string

Types

type Bot

type Bot interface {
	Response(args ResponseRequest) string
	ReceiveUpdate() (UpdateEvent, error)
}

func InitBot

func InitBot(kubeconfig *restclient.Config, annotation, siteSuffix string, authSVCLabels string, stopCh <-chan struct{}) (Bot, error)

type PRLock

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

func NewPRLock

func NewPRLock() *PRLock

func (*PRLock) Lock

func (l *PRLock) Lock(repo string, pr int)

func (*PRLock) Unlock

func (l *PRLock) Unlock(repo string, pr int)

type ResponseRequest

type ResponseRequest struct {
	Email        string
	Body         string
	RepoURL      string
	Namespace    string
	OriginBranch string
	CloneBranch  string
	PR           int
	Annotations  map[string]string
}

type UpdateEvent

type UpdateEvent struct {
	Message     string
	PR          int
	RepoURL     string
	Type        string
	Annotations map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳