gh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthFS

type AuthFS struct {
	Secrets metadata.Secrets
}

func NewAuthFS

func NewAuthFS() *AuthFS

Returns an AuthFS object, responsible for managing authentication on the local FS. This is meant to be used by the cli on the user's local filesystem.

func (*AuthFS) CheckGithubAuth

func (a *AuthFS) CheckGithubAuth(ctx context.Context) error

func (*AuthFS) Close

func (a *AuthFS) Close()

func (*AuthFS) GetGithubUserLogin

func (a *AuthFS) GetGithubUserLogin(ctx context.Context) (string, string, error)

func (*AuthFS) Login

func (a *AuthFS) Login(ctx context.Context) error

Login will attempt to read any existing github credentials from disk. If unavailable, it will initiate oauth with github.

func (*AuthFS) Logout

func (a *AuthFS) Logout(ctx context.Context) error

func (*AuthFS) Status

func (a *AuthFS) Status(ctx context.Context)

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) GetUser

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

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