github

package
v0.0.0-...-4d82e29 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDFromUsername

func GetIDFromUsername(username string) (int64, error)

GetIDFromUsername function returns github id of the user with provided github username

func GetUserGithubOrganizations

func GetUserGithubOrganizations(username string) ([]string, error)

GetUserGithubOrganizations returns list of organizations of which given user is part of. It only returns organizations of the user where organization membership info is public. It takes github username as input.

func GetUsernameFromID

func GetUsernameFromID(id int64) (string, error)

GetUsernameFromID function returns github username of provided github user id.

func Init

func Init(conf config.Config)

Init function initialize github service. service is used internally only by this package. TODO() : add authorization in client.

Types

type Client

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

Client is container for go-github Client

func NewGithubAppClient

func NewGithubAppClient(installationID int64) (*Client, error)

NewGithubAppClient function creates github client for installation

func (*Client) ListCommits

func (gc *Client) ListCommits(owner string, repo string, pullReqNumber int) (*Commits, error)

ListCommits returns list of commits on pull request

type CommitAuthor

type CommitAuthor struct {
	SHA            string
	AuthorID       int64
	AuthorUsername string
	AuthorEmail    string
}

CommitAuthor is information about author of particular commit

type Commits

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

Commits contains commits for particular pull request

func (*Commits) GetCommitAuthors

func (c *Commits) GetCommitAuthors() []*CommitAuthor

GetCommitAuthors function return list of authors of pull request

Jump to

Keyboard shortcuts

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