github

package
v0.0.0-...-88ab25c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaskOptions

func MaskOptions(opts *Options) string

Types

type APIEndpoint

type APIEndpoint *url.URL

func ValidateAPIEndpoint

func ValidateAPIEndpoint(unsafeAPIEndpoint string) (APIEndpoint, error)

type HttpFunc

type HttpFunc func(request *http.Request) (*http.Response, error)

func NewHttp

func NewHttp() HttpFunc

type Options

type Options struct {
	Tmpl          *l10n.Template
	SendIfSuccess bool
	Token         Token
	APIEndpoint   APIEndpoint
	Owner         Owner
	Repo          Repo
	PullNumber    PullNumber
}

type Owner

type Owner string

func ValidateOwner

func ValidateOwner(unsafeOwner string) (Owner, error)

type PullNumber

type PullNumber int

func ValidatePullNumber

func ValidatePullNumber(unsafePullNumber int) (PullNumber, error)

type PullRequestComment

type PullRequestComment struct {
	Body string `json:"body"`
}

type PullRequestCommentSender

type PullRequestCommentSender func(githubEndpoint APIEndpoint, token Token, owner Owner, repo Repo, pullNumber PullNumber, comment string) error

func NewPullRequestCommentSender

func NewPullRequestCommentSender(send HttpFunc, logger logging.Logger) PullRequestCommentSender

type Repo

type Repo string

func ValidateRepo

func ValidateRepo(unsafeRepo string) (Repo, error)

type SendFunc

type SendFunc func(result *checker.CheckResult, opts *Options) error

func NewSendFunc

func NewSendFunc(postComment PullRequestCommentSender) SendFunc

func SpySendFunc

func SpySendFunc(inherited SendFunc, callArgs *[]SendFuncCallArgs) SendFunc

func StubSendFunc

func StubSendFunc(err error) SendFunc

type SendFuncCallArgs

type SendFuncCallArgs struct {
	Result  *checker.CheckResult
	Options *Options
}

type Token

type Token string

func ValidateToken

func ValidateToken(unsafeToken string) (Token, error)

Jump to

Keyboard shortcuts

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