githubapp

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMock

func NewMock() (Factory, *Mock)

Types

type Client

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

func (*Client) CreateCheckRun

func (x *Client) CreateCheckRun(repo *model.GitHubRepo, commit string) (int64, error)

func (*Client) CreateIssueComment

func (x *Client) CreateIssueComment(repo *model.GitHubRepo, prID int, body string) error

func (*Client) GetCodeZip

func (x *Client) GetCodeZip(repo *model.GitHubRepo, commitID string, w io.WriteCloser) error

func (*Client) UpdateCheckRun

func (x *Client) UpdateCheckRun(repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error

type Factory

type Factory func(appID, installID int64, pem []byte) Interface

type Interface

type Interface interface {
	GetCodeZip(repo *model.GitHubRepo, commitID string, w io.WriteCloser) error
	CreateIssueComment(repo *model.GitHubRepo, prID int, body string) error
	CreateCheckRun(repo *model.GitHubRepo, commit string) (int64, error)
	UpdateCheckRun(repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error
}

func New

func New(appID, installID int64, pem []byte) Interface

type Mock

type Mock struct {
	GetCodeZipMock         func(repo *model.GitHubRepo, commitID string, w io.WriteCloser) error
	CreateIssueCommentMock func(repo *model.GitHubRepo, prID int, body string) error
	CreateCheckRunMock     func(repo *model.GitHubRepo, commit string) (int64, error)
	UpdateCheckRunMock     func(repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error

	AppID     int64
	InstallID int64
	PEM       []byte
}

func (*Mock) CreateCheckRun

func (x *Mock) CreateCheckRun(repo *model.GitHubRepo, commit string) (int64, error)

func (*Mock) CreateIssueComment

func (x *Mock) CreateIssueComment(repo *model.GitHubRepo, prID int, body string) error

func (*Mock) GetCodeZip

func (x *Mock) GetCodeZip(repo *model.GitHubRepo, commitID string, w io.WriteCloser) error

func (*Mock) UpdateCheckRun

func (x *Mock) UpdateCheckRun(repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error

Jump to

Keyboard shortcuts

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