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/>.
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/>.
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/>.
Index ¶
- func ExtractRepoName(fullPath string) string
- func ExtractRepoOwner(fullPath string) string
- func NormalizeRepoPath(input string) string
- type Client
- type GitHubClient
- func (c *GitHubClient) CheckRepoExists(name string) (bool, error)
- func (c *GitHubClient) CodeBasedAuthentication(clientID string, io cout.IO) (string, error)
- func (c *GitHubClient) CreateRepo(name string) error
- func (c *GitHubClient) GetCloneURL(name string) (string, error)
- func (c *GitHubClient) GetCurrentUserLogin() (string, error)
- func (c *GitHubClient) GetUserIdentity() (string, string, error)
- func (c *GitHubClient) PKCEAuthentication(clientID, clientSecret string, io cout.IO) (string, error)
- func (c *GitHubClient) SetToken(token string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRepoName ¶
func ExtractRepoOwner ¶
func NormalizeRepoPath ¶
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 (*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 (*GitHubClient) SetToken ¶
func (c *GitHubClient) SetToken(token string)