github

package
v0.4.7-rc2026010804 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitHubSource

func NewGitHubSource(config source.Config) source.Source

NewGitHubSource creates a new GitHub source

Types

type GitHubInstance

type GitHubInstance struct {
	BaseUrl string
	ApiUrl  string
}

GitHubInstance represents a GitHub instance (public or enterprise)

type GitHubReleaseApiResponse

type GitHubReleaseApiResponse struct {
	Id     int                  `json:"id"`
	Url    string               `json:"url"`
	Name   string               `json:"name"`
	Assets []GitHubReleaseAsset `json:"assets"`
}

GitHubReleaseApiResponse models GitHub API /repos/:owner/:repo/releases/tags/:tag response

type GitHubReleaseAsset

type GitHubReleaseAsset struct {
	Id   int    `json:"id"`
	Url  string `json:"url"`
	Name string `json:"name"`
}

GitHubReleaseAsset models asset info in release response

type GitHubSource

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

GitHubSource implements source.Source for GitHub

func (*GitHubSource) DownloadReleaseAsset

func (s *GitHubSource) DownloadReleaseAsset(repo source.Repo, asset source.ReleaseAsset, destPath string, withProgress bool) error

DownloadReleaseAsset downloads a release asset to destPath

func (*GitHubSource) DownloadSourceZip

func (s *GitHubSource) DownloadSourceZip(repo source.Repo, gitRef string) (string, error)

DownloadSourceZip downloads repo archive for a git ref and returns temp file path

func (*GitHubSource) FetchTags

func (s *GitHubSource) FetchTags(repoUrl, token string) ([]string, error)

FetchTags returns all semver tags from the repository

func (*GitHubSource) GetReleaseInfo

func (s *GitHubSource) GetReleaseInfo(repo source.Repo, tag string) (source.Release, error)

GetReleaseInfo returns release information for a specific tag

func (*GitHubSource) MakeArchiveRequest

func (s *GitHubSource) MakeArchiveRequest(commit source.Commit, token string) (*http.Request, error)

MakeArchiveRequest creates HTTP request to download repo archive

func (*GitHubSource) ParseUrl

func (s *GitHubSource) ParseUrl(repoUrl, token string) (source.Repo, error)

ParseUrl parses a GitHub repo URL into a Repo struct

func (*GitHubSource) Type

func (s *GitHubSource) Type() source.SourceType

Type returns the source type

type GitHubTagsApiResponse

type GitHubTagsApiResponse struct {
	Name       string `json:"name"`
	ZipBallUrl string `json:"zipball_url"`
	TarballUrl string `json:"tarball_url"`
	Commit     GitHubTagsCommitApiResponse
}

GitHubTagsApiResponse models GitHub API /repos/:owner/:repo/tags response

type GitHubTagsCommitApiResponse

type GitHubTagsCommitApiResponse struct {
	Sha string `json:"sha"`
	Url string `json:"url"`
}

GitHubTagsCommitApiResponse models commit info in tags response

Jump to

Keyboard shortcuts

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