github

package
v0.1.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright © 2025 Gonzalo Alvarez

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRepoName

func ExtractRepoName(fullPath string) string

func ExtractRepoOwner

func ExtractRepoOwner(fullPath string) string

func NormalizeRepoPath

func NormalizeRepoPath(input string) string

Types

type Client

type Client interface {
	CodeBasedAuthentication(clientID string, io cout.IO) (string, error)
	PKCEAuthentication(clientID, clientSecret string, io cout.IO) (string, error)
	SetToken(token string)
	GetUserIdentity() (name string, email string, err error)
	GetCurrentUserLogin() (string, error)
	CheckRepoExists(name string) (bool, error)
	CreateRepo(name string) error
	GetCloneURL(name string) (string, error)
}

type GitHubClient

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

func NewGitHubClient

func NewGitHubClient() *GitHubClient

func (*GitHubClient) CheckRepoExists

func (c *GitHubClient) CheckRepoExists(name string) (bool, error)

func (*GitHubClient) CodeBasedAuthentication

func (c *GitHubClient) CodeBasedAuthentication(clientID string, io cout.IO) (string, error)

func (*GitHubClient) CreateRepo

func (c *GitHubClient) CreateRepo(name string) error

func (*GitHubClient) GetCloneURL

func (c *GitHubClient) GetCloneURL(name string) (string, error)

This is used primarily for CI testing.

func (*GitHubClient) GetCurrentUserLogin

func (c *GitHubClient) GetCurrentUserLogin() (string, error)

func (*GitHubClient) GetUserIdentity

func (c *GitHubClient) GetUserIdentity() (string, string, error)

func (*GitHubClient) PKCEAuthentication

func (c *GitHubClient) PKCEAuthentication(clientID, clientSecret string, io cout.IO) (string, error)

func (*GitHubClient) SetToken

func (c *GitHubClient) SetToken(token string)

Jump to

Keyboard shortcuts

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