github

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRepo added in v0.0.7

func GetRepo(repoPath string) (string, string)

GetRepo returns the user/org name and the repo name of the configured GitHub repository. Expected input: "owner/repo"

TODO(github): Consider whether sigs.k8s.io/release-sdk can be used here.

Types

type Client

type Client interface {
	ListIssues(owner, repo string) ([]*gogh.Issue, error)
	ListComments(
		owner, repo string, issue *gogh.Issue, since time.Time,
	) ([]*gogh.IssueComment, error)
	GetUser(login string) (*gogh.User, error)
}

Client is a wrapper around the GitHub API Client library we use. It allows us to swap in other implementations, such as a dry run clients, or mock clients for testing.

func New

func New(token string) (Client, error)

New creates a GitHubClient and returns it; which implementation it uses depends on the configuration of this run. For example, a dry-run clients may be created which does not make any requests that would change anything on the server, but instead simply prints out the actions that it's asked to take.

Jump to

Keyboard shortcuts

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