github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github provides functionality for interacting with GitHub releases and checking for updates to the ephemeral files CLI.

Index

Constants

View Source
const (
	// DefaultEndpoint is the default GitHub API endpoint.
	DefaultEndpoint = "https://api.github.com"
	// DefaultAPIRequestTimeout is the default timeout for GitHub API requests.
	DefaultAPIRequestTimeout = 5 * time.Second
)

Variables

View Source
var (
	// ErrGettingLatestRelease is returned when failing to fetch the latest release from GitHub.
	ErrGettingLatestRelease = errors.New("error getting latest release")
)

Functions

This section is empty.

Types

type Client

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

Client represents a GitHub API client for fetching release information.

func NewClient

func NewClient() *Client

NewClient creates a new GitHub API client with default settings.

func (*Client) GetLastVersionFromGithub

func (s *Client) GetLastVersionFromGithub(repository string) (string, error)

GetLastVersionFromGithub gets the last version from github.

func (*Client) SetEndpoint

func (s *Client) SetEndpoint(endpoint string)

SetEndpoint sets the GitHub API endpoint for the client.

func (*Client) SetHTTPClient

func (s *Client) SetHTTPClient(client *http.Client)

SetHTTPClient sets the HTTP client for the GitHub client.

type ResponseLatestRelease

type ResponseLatestRelease struct {
	TagName string `json:"tag_name"`
}

ResponseLatestRelease represents the response from GitHub's latest release API.

Jump to

Keyboard shortcuts

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