Help us shape the future of Go! Take the 2026 Go Developer Survey

github

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReleaseAlreadyExists = fmt.Errorf("release already exists")
	ErrReleaseNotFound      = fmt.Errorf("release not found")
)

Functions

This section is empty.

Types

type GitHubCli

type GitHubCli struct {
	// ExecutablePath is the path to the GitHub CLI executable
	ExecutablePath string

	// DefaultRepo is the default repository to use if none is specified
	DefaultRepo string
}

GitHubCli provides access to GitHub CLI functionality

func NewGitHubCli

func NewGitHubCli() (*GitHubCli, error)

NewGitHubCli creates a new GitHub CLI wrapper

func (*GitHubCli) CheckAndGetInstallError

func (gh *GitHubCli) CheckAndGetInstallError() error

CheckAndGetInstallError checks if GitHub CLI is installed and returns a structured error if it's not.

func (*GitHubCli) CreateRelease

func (gh *GitHubCli) CreateRelease(cwd string, tagName string, opts map[string]string, assets []string) (*Release, error)

CreateRelease creates a new GitHub release

func (*GitHubCli) GetInstallInstructions

func (gh *GitHubCli) GetInstallInstructions() string

GetInstallInstructions returns OS-specific instructions for installing GitHub CLI (legacy method)

func (*GitHubCli) IsAuthenticated

func (gh *GitHubCli) IsAuthenticated() (bool, error)

IsAuthenticated checks if the user is authenticated with GitHub

func (*GitHubCli) IsInstalled

func (gh *GitHubCli) IsInstalled() (bool, error)

IsInstalled checks if the GitHub CLI is installed and available

func (*GitHubCli) ViewRelease

func (gh *GitHubCli) ViewRelease(cwd string, repo string, tagName string) (*Release, error)

ViewRelease gets information about a GitHub release

func (*GitHubCli) ViewRepository

func (gh *GitHubCli) ViewRepository(cwd string, repo string) (*Repository, error)

ViewRepository gets information about a GitHub repository

type Release

type Release struct {
	Name    string          `json:"name"`
	TagName string          `json:"tagName"`
	Url     string          `json:"url"`
	Assets  []*ReleaseAsset `json:"assets"`
}

Release represents a GitHub release

type ReleaseAsset

type ReleaseAsset struct {
	Id          string `json:"id"`
	ContentType string `json:"contentType"`
	Name        string `json:"name"`
	Size        int64  `json:"size"`
	State       string `json:"state"`
	Url         string `json:"url"`
	Path        string `json:"path"` // Local path when downloaded
}

ReleaseAsset represents an asset attached to a GitHub release

type Repository

type Repository struct {
	Name string `json:"nameWithOwner"`
	Url  string `json:"url"`
}

Repository represents a GitHub repository

Jump to

Keyboard shortcuts

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