events

package
v0.0.0-...-c14c6da Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultExternalURL = "http://localhost:3000"
View Source
const HookScript = "bass/github-hook"

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Log       *logs.Logger
	DB        *models.Conn
	Blobs     *blobs.Bucket
	Config    *cfg.Config
	Transport *ghapp.Transport
	// contains filtered or unexported fields
}

func Load

func Load(log *logs.Logger, config *cfg.Config, db *models.Conn, blobs *blobs.Bucket, transport *ghapp.Transport) *Controller

func (*Controller) Create

func (c *Controller) Create(w http.ResponseWriter, r *http.Request)

type GitHubEventPayload

type GitHubEventPayload struct {
	// set on many events
	Action *string `json:"action,omitempty"`

	// set on push events
	After *string `json:"after,omitempty"`

	// set on check_suite events
	CheckSuite *github.CheckSuite `json:"check_suite,omitempty"`

	// set on check_run events
	CheckRun *github.CheckRun `json:"check_run,omitempty"`

	// set on pull_request events
	PullRequest *github.PullRequest `json:"pull_request,omitempty"`

	// set on all events
	Repo         *github.Repository   `json:"repository,omitempty"`
	Sender       *github.User         `json:"sender,omitempty"`
	Installation *github.Installation `json:"installation,omitempty"`
}

func (GitHubEventPayload) Meta

func (event GitHubEventPayload) Meta() models.Meta

func (*GitHubEventPayload) RefToLoad

func (event *GitHubEventPayload) RefToLoad(ctx context.Context, ghClient *github.Client) (string, error)

RefToLoad determines the ref to use for dispatching the event.

For check_suite events, this is the check_suite.head_sha.

For check_run events, this is the check_run.head_sha.

For pull_request events, this is the pull_request.head.sha.

For every other event, this is the repo's default branch's current sha.

func (*GitHubEventPayload) SHA

func (event *GitHubEventPayload) SHA() string

Jump to

Keyboard shortcuts

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