Documentation ¶
Index ¶
- func ParseOwnerRepo(githubURL string) (string, string, error)
- func SanitizedErrorMessage(err error) string
- type GithubClient
- func (gc *GithubClient) CreateRepo(ctx context.Context, owner, repoName string, description string, private bool) (*github.Repository, error)
- func (gc *GithubClient) GetAllUserInstallations(ctx context.Context, filterSuspended bool) ([]*github.Installation, error)
- func (gc *GithubClient) GetAllUserRepositories(ctx context.Context, username string) ([]*github.Repository, error)
- func (gc *GithubClient) GetUser(ctx context.Context) (*github.User, error)
- func (gc *GithubClient) GetUserEmails(ctx context.Context) ([]*github.UserEmail, error)
- func (gc *GithubClient) GetUserOrganizations(ctx context.Context) ([]string, error)
- func (gc *GithubClient) Init(ctx context.Context, owner, repoName string, private bool) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseOwnerRepo ¶ added in v0.2.14
func SanitizedErrorMessage ¶ added in v0.2.32
Parses GitHub's errors for cleaner error messages
Types ¶
type GithubClient ¶
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) GetUserEmails ¶ added in v0.3.0
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
Click to show internal directories.
Click to hide internal directories.