Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	EventTypePullRequest = EventType("pull_request")
	EventTypePush        = EventType("push")

	PullRequestStateOpen   = PullRequestState("open")
	PullRequestStateClosed = PullRequestState("closed")

	PullRequestActionReOpen      = PullRequestAction("reopened")
	PullRequestActionOpen        = PullRequestAction("opened")
	PullRequestActionClose       = PullRequestAction("closed")
	PullRequestActionSynchronize = PullRequestAction("synchronize")
)

Variables

This section is empty.

Functions

func RequestHttp

func RequestHttp(method string, uri string, header map[string]string, data interface{}) ([]byte, http.Header, error)

Types

type Base

type Base struct {
	Ref string
}

type Client

type Client interface {
	// Webhooks
	ListWebhook(integrationConfig *cicdv1.IntegrationConfig, c client.Client) ([]WebhookEntry, error)
	RegisterWebhook(integrationConfig *cicdv1.IntegrationConfig, url string, c client.Client) error
	DeleteWebhook(integrationConfig *cicdv1.IntegrationConfig, id int, c client.Client) error
	ParseWebhook(*cicdv1.IntegrationConfig, http.Header, []byte) (Webhook, error)

	// Commit Status
	SetCommitStatus(integrationJob *cicdv1.IntegrationJob, integrationConfig *cicdv1.IntegrationConfig, context string, state CommitStatusState, description, targetUrl string, c client.Client) error
}

type CommitStatusState

type CommitStatusState string

type EventType

type EventType string
type Head struct {
	Ref string
	Sha string
}

type PullRequest

type PullRequest struct {
	ID     int
	Title  string
	State  PullRequestState
	Action PullRequestAction
	Sender Sender
	URL    string
	Base   Base
	Head   Head
}

type PullRequestAction

type PullRequestAction string

type PullRequestState

type PullRequestState string

type Push

type Push struct {
	Pusher string
	Ref    string
	Sha    string
}

type Repository

type Repository struct {
	Name string
	URL  string
}

type Sender

type Sender struct {
	Name string
}

type Webhook

type Webhook struct {
	EventType EventType
	Repo      Repository

	Push        *Push
	PullRequest *PullRequest
	Action      string
}

Webhook is a common structure for git webhooks github-specific or gitlab-specific webhook bodies are converted to this structure before being consumed

type WebhookEntry

type WebhookEntry struct {
	Id  int
	Url string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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