github

package
v0.0.0-...-453582f Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddComment

func AddComment(ctx context.Context, gr gerrit.Client, project string, change string, commit string, changeURL string, patchset string, postComment func(ctc context.Context, orgRepo string, issue string, message string) error) error

AddComment handles incoming hook call by gerrit for patchset-created events.

func LoadInstanceTransport

func LoadInstanceTransport(appID, instanceID, privateKeyPEMPath string) (http.RoundTripper, error)

LoadInstanceTransport creates a new instance authentication.

Types

type Authorization

type Authorization interface {
	Add(req *http.Request) error
}

Authorization implements authorization for http.Requests.

type Client

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

Client is a simplified REST Api client for specific Github functionalities.

func NewClient

func NewClient(log *zap.Logger, client *http.Client) Client

NewClient creates a new Github REST client.

func (*Client) PostGithubComment

func (g *Client) PostGithubComment(ctx context.Context, orgRepo string, issue string, message string) error

PostGithubComment adds a new comment to a github issue.

type Token

type Token string

Token implements transport for adding Personal Access Token.

func (Token) RoundTrip

func (pat Token) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip adds authorization header to the request.

Jump to

Keyboard shortcuts

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