domain

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSData

type AWSData struct {
	Region               string
	AccountID            string
	CodeBuildProjectName string
}

type BuildInput

type BuildInput struct {
	Builds     []*codebuild.StartBuildInput
	BatchBuild *codebuild.StartBuildBatchInput
	Batched    bool
	Empty      bool
}

type Data

type Data struct {
	Event             Event
	PullRequest       PullRequest
	Repository        Repository
	HeadCommitMessage mutex.String
	SHA               string
	Ref               string
	GitHub            GitHub
	Commit            mutex.Commit
	AWS               AWSData
}

Data contains data which is referred in expression engine and template engine. To reduce unneeded HTTP API call, in Data's many functions API isn't called until the API call is really needed, and the result is cached in the request scope.

func NewData

func NewData() Data

func (*Data) CommitMessage

func (data *Data) CommitMessage() string

func (*Data) Convert

func (data *Data) Convert() map[string]interface{}

func (*Data) GetCommit

func (data *Data) GetCommit() *github.Commit

func (*Data) GetPR

func (data *Data) GetPR() *github.PullRequest

func (*Data) GetPRFileNames

func (data *Data) GetPRFileNames() []string

func (*Data) GetPRFiles

func (data *Data) GetPRFiles() []*github.CommitFile

func (*Data) GetPRLabelNames

func (data *Data) GetPRLabelNames() []string

func (*Data) GetPRNumber

func (data *Data) GetPRNumber() int

type Event

type Event struct {
	Body    string  `json:"body"`
	Headers Headers `json:"headers"`

	Payload interface{} `json:"-"`
}

type GitHub

type GitHub interface {
	GetCommit(ctx context.Context, owner, repo, sha string) (*github.Commit, error)
	GetPR(ctx context.Context, owner, repo string, number int) (*github.PullRequest, error)
	GetPRFiles(ctx context.Context, owner, repo string, number int, opt *github.ListOptions) ([]*github.CommitFile, error)
	GetPRsWithCommit(ctx context.Context, owner, repo string, sha string) ([]*github.PullRequest, error)
	GetContents(ctx context.Context, owner, repo, path, ref string) (*github.RepositoryContent, []*github.RepositoryContent, error)
	CreateCommitComment(ctx context.Context, owner, repo, sha, body string) error
	CreatePRComment(ctx context.Context, owner, repo string, number int, body string) error
}

type Headers

type Headers struct {
	Event     string `json:"x-github-event"`
	Delivery  string `json:"x-github-delivery"`
	Signature string `json:"x-hub-signature-256"`
}

type PullRequest

type PullRequest struct {
	ChangedFileNames mutex.StringList
	LabelNames       mutex.StringList
	PullRequest      mutex.PR
	Files            mutex.CommitFiles
	Number           mutex.Int
}

func NewPullRequest

func NewPullRequest() PullRequest

type Repository

type Repository struct {
	FullName string
	Owner    string
	Name     string
}

Jump to

Keyboard shortcuts

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