github

package
v0.0.0-...-0c89093 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CheckEvent

type CheckEvent struct {
	GenericGithubEvent
	// contains filtered or unexported fields
}

func NewCheckEvent

func NewCheckEvent(clientCreator githubapp.ClientCreator, event GenericGithubEvent, config *config.Config) (*CheckEvent, error)

func (*CheckEvent) CreateAggregatedCheckRun

func (e *CheckEvent) CreateAggregatedCheckRun(checkType terraform.TfCheckType) (GhCheckRun, error)

func (*CheckEvent) GetBranch

func (e *CheckEvent) GetBranch() string

func (*CheckEvent) GetGhClient

func (e *CheckEvent) GetGhClient() *github.Client

func (*CheckEvent) GetPRURL

func (e *CheckEvent) GetPRURL() string

func (*CheckEvent) GetRepo

func (e *CheckEvent) GetRepo() *Repo

func (*CheckEvent) GetSHA

func (e *CheckEvent) GetSHA() string

func (*CheckEvent) GetToken

func (e *CheckEvent) GetToken() string

func (*CheckEvent) UpdateAggregatedCheckRun

func (e *CheckEvent) UpdateAggregatedCheckRun(cr GhCheckRun, checks []terraform.TfCheck)

type CheckHandler

type CheckHandler struct {
	Client githubapp.ClientCreator
	Config *config.Config
}

func (*CheckHandler) Handle

func (h *CheckHandler) Handle(_ context.Context, eventType, _ string, payload []byte) error

func (*CheckHandler) Handles

func (h *CheckHandler) Handles() []string

func (*CheckHandler) Init

func (h *CheckHandler) Init()

type CheckRunEvent

type CheckRunEvent struct{ *github.CheckRunEvent }

Rename external struct to be able to extend them with interface func.

func (CheckRunEvent) GetHeadBranch

func (e CheckRunEvent) GetHeadBranch() string

func (CheckRunEvent) GetHeadSHA

func (e CheckRunEvent) GetHeadSHA() string

func (CheckRunEvent) GetRepo

func (e CheckRunEvent) GetRepo() Repo

CheckRunEvent.

func (CheckRunEvent) IsValid

func (e CheckRunEvent) IsValid(c *config.Config) bool

func (CheckRunEvent) PrURL

func (e CheckRunEvent) PrURL() string

type CheckSuiteEvent

type CheckSuiteEvent struct{ *github.CheckSuiteEvent }

Rename external struct to be able to extend them with interface func.

func (CheckSuiteEvent) GetHeadBranch

func (e CheckSuiteEvent) GetHeadBranch() string

func (CheckSuiteEvent) GetHeadSHA

func (e CheckSuiteEvent) GetHeadSHA() string

func (CheckSuiteEvent) GetRepo

func (e CheckSuiteEvent) GetRepo() Repo

CheckSuiteEvent.

func (CheckSuiteEvent) IsValid

func (e CheckSuiteEvent) IsValid(c *config.Config) bool

func (CheckSuiteEvent) PrURL

func (e CheckSuiteEvent) PrURL() string

type GenericGithubEvent

type GenericGithubEvent interface {
	githubapp.InstallationSource

	GetRepo() Repo
	GetHeadSHA() string
	GetHeadBranch() string
	IsValid(*config.Config) bool
	PrURL() string
}

GenericGithubEvent aims to factorize code for even treatment.

type GhCheckRun

type GhCheckRun struct {
	Name string
	ID   int64
}

type PullRequestEvent

type PullRequestEvent struct{ *github.PullRequestEvent }

Rename external struct to be able to extend them with interface func.

func (PullRequestEvent) GetHeadBranch

func (e PullRequestEvent) GetHeadBranch() string

func (PullRequestEvent) GetHeadSHA

func (e PullRequestEvent) GetHeadSHA() string

func (PullRequestEvent) GetRepo

func (e PullRequestEvent) GetRepo() Repo

PullRequestEvent.

func (PullRequestEvent) IsValid

func (e PullRequestEvent) IsValid(_ *config.Config) bool

func (PullRequestEvent) PrURL

func (e PullRequestEvent) PrURL() string

type Repo

type Repo struct {
	*github.Repository
}

func (*Repo) HasTopic

func (r *Repo) HasTopic(t string) bool

func (*Repo) IsValid

func (r *Repo) IsValid(config *config.Config) (ok bool, err error)

Jump to

Keyboard shortcuts

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