gh

package
v0.3.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOwnerRepo added in v0.2.14

func ParseOwnerRepo(githubURL string) (string, string, error)

func SanitizedErrorMessage added in v0.2.32

func SanitizedErrorMessage(err error) string

Parses GitHub's errors for cleaner error messages

Types

type GithubClient

type GithubClient struct {
	*github.Client
}

A simple wrapper around the github client, exposing additional functionality relevant to lekko.

func NewGithubClient

func NewGithubClient(h *http.Client) *GithubClient

func NewGithubClientFromToken

func NewGithubClientFromToken(ctx context.Context, token string) *GithubClient

func (*GithubClient) CreateRepo added in v0.2.28

func (gc *GithubClient) CreateRepo(ctx context.Context, owner, repoName string, description string, private bool) (*github.Repository, error)

func (*GithubClient) GetAllUserInstallations added in v0.2.29

func (gc *GithubClient) GetAllUserInstallations(ctx context.Context, filterSuspended bool) ([]*github.Installation, error)

GetAllUserInstallations gets all installations for a user

func (*GithubClient) GetAllUserRepositories added in v0.2.28

func (gc *GithubClient) GetAllUserRepositories(ctx context.Context, username string) ([]*github.Repository, error)

GetAuthenticatedRepos gets all repos for a user. Passing the empty string will list repositories for the authenticated user.

func (*GithubClient) GetUser

func (gc *GithubClient) GetUser(ctx context.Context) (*github.User, error)

func (*GithubClient) GetUserEmails added in v0.3.0

func (gc *GithubClient) GetUserEmails(ctx context.Context) ([]*github.UserEmail, error)

func (*GithubClient) GetUserOrganizations added in v0.2.16

func (gc *GithubClient) GetUserOrganizations(ctx context.Context) ([]string, error)

GetUserOrganizations uses an authenticated call to get the users private and public organizations

func (*GithubClient) Init

func (gc *GithubClient) Init(ctx context.Context, owner, repoName string, private bool) (string, error)

Init will create a new github repo based off of lekko's config repo template.

Jump to

Keyboard shortcuts

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