Documentation
¶
Index ¶
- func GetRepoNames(repos []Repository) []string
- type Client
- func (c *Client) CreateRelease(owner, repo, tag, releaseNotes string) error
- func (c *Client) CreateRepo(repoName, description string, private bool) error
- func (c *Client) DeleteRepo(repoName string) error
- func (c *Client) GetReleases(owner, repo string) ([]string, error)
- func (c *Client) GetRepo(repoName string) (Repository, bool, error)
- func (c *Client) GetRepoDescription(repoName string) (string, bool, error)
- func (c *Client) HasToken() bool
- func (c *Client) ListPublicRepos() ([]Repository, error)
- func (c *Client) RepoExists(repoName string) (bool, error)
- func (c *Client) UpdateRelease(owner, repo, tag, releaseNotes string) error
- func (c *Client) UpdateRepoDescription(repoName, description string) error
- type CreateRepoRequest
- type CreateRepoResponse
- type ErrorResponse
- type Release
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepoNames ¶
func GetRepoNames(repos []Repository) []string
GetRepoNames extracts repository names from a list of repos
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles GitHub API operations
func (*Client) CreateRelease ¶ added in v0.19.3
CreateRelease creates a release for the given tag on GitHub.
func (*Client) CreateRepo ¶
CreateRepo creates a new repository
func (*Client) DeleteRepo ¶
DeleteRepo deletes a repository from GitHub
func (*Client) GetReleases ¶ added in v0.19.3
GetReleases fetches the tag names of existing releases for the repository. A 404 (repository missing on GitHub) is normalized to an empty result so the caller can treat it as "no releases yet" instead of an error. No token is required: when the client has no token the request is sent unauthenticated, which still lists releases for public repositories (matching GitHub's unauthenticated rate-limited access).
func (*Client) GetRepo ¶ added in v0.9.0
func (c *Client) GetRepo(repoName string) (Repository, bool, error)
GetRepo fetches a single repository by name Returns the repository, a boolean indicating existence, and an error
func (*Client) GetRepoDescription ¶ added in v0.18.3
GetRepoDescription fetches a repository description.
func (*Client) ListPublicRepos ¶
func (c *Client) ListPublicRepos() ([]Repository, error)
ListPublicRepos lists all public repositories for the user/org
func (*Client) RepoExists ¶
RepoExists checks if a repository exists
func (*Client) UpdateRelease ¶ added in v0.19.3
UpdateRelease updates the body of an existing release for the given tag on GitHub.
func (*Client) UpdateRepoDescription ¶ added in v0.9.0
UpdateRepoDescription updates the repository description
type CreateRepoRequest ¶
type CreateRepoRequest struct {
Name string `json:"name"`
Description string `json:"description"`
Private bool `json:"private"`
AutoInit bool `json:"auto_init"`
}
CreateRepoRequest represents the request to create a repository
type CreateRepoResponse ¶
type CreateRepoResponse struct {
ID int64 `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Private bool `json:"private"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`
}
CreateRepoResponse represents the response from creating a repository
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
Errors []struct {
Resource string `json:"resource"`
Field string `json:"field"`
Code string `json:"code"`
} `json:"errors,omitempty"`
}
ErrorResponse represents an error response from GitHub API