github

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBreak    = errors.New("break")
	ErrNotFound = errors.New("not found")
)

Functions

func EnumTags

func EnumTags(pkgPath string, page int, pager func(tags []*Tag, page, total int) error) (err error)

EnumTags enumerates the tags of a GitHub repository.

Types

type Author

type Author struct {
	Login     string `json:"login"`      // github-actions[bot]
	ID        int    `json:"id"`         // 41898282
	NodeID    string `json:"node_id"`    // MDM6Qm90NDE4OTgyODI=
	AvatarURL string `json:"avatar_url"` // https://avatars.githubusercontent.com/in/15368?v=4
	URL       string `json:"url"`        // https://api.github.com/users/github-actions%5Bbot%5D
	HtmlURL   string `json:"html_url"`   // https://github.com/apps/github-actions
	Type      string `json:"type"`       // Bot
	SiteAdmin bool   `json:"site_admin"` // false
}

Author represents a github user or bot.

type Commit

type Commit struct {
	SHA string `json:"sha"`
	URL string `json:"url"`
}

Commit represents a commit in a GitHub repository.

type CommitAuthor

type CommitAuthor struct {
	Name  string `json:"name"`  // xushiwei
	Email string `json:"email"` // x@goplus.org
	Date  string `json:"date"`  // 2025-04-21T14:13:29Z
}

CommitAuthor represents the author of a GitHub commit.

type CommitDetail

type CommitDetail struct {
	NodeID string        `json:"node_id"` // C_kwDOAtpGOtoAKDE2OGEwODlmOWY5ZTNhNDdhMTliMTRjZDczODQ4N2M2ZTJkMTMxYmE
	Commit CommitSummary `json:"commit"`
	Author Author        `json:"author"`
}

CommitDetail represents the details of a GitHub commit.

func GetCommit

func GetCommit(pkgPath, shaOrURL string) (ret *CommitDetail, err error)

GetCommit retrieves the details of a specific commit from a GitHub repository.

type CommitSummary

type CommitSummary struct {
	Author  CommitAuthor `json:"author"`
	Message string       `json:"message"` // Merge pull request #2296 from goplus/main\n\nv1.4.0
}

CommitSummary represents the summary of a GitHub commit.

type Release

type Release struct {
	URL             string          `json:"url"`              // https://api.github.com/repos/flintlib/flint/releases/209285187
	ID              int             `json:"id"`               // 209285187
	NodeID          string          `json:"node_id"`          // RE_kwDOAC8YHs4MeXBD
	TagName         string          `json:"tag_name"`         // v3.2.2
	TargetCommitish string          `json:"target_commitish"` // b8223680e38ad048355a421bf7f617bb6c5d5e12
	Name            string          `json:"name"`             // FLINT v3.2.2
	PublishedAt     string          `json:"published_at"`     // 2025-03-31T08:54:16Z
	Body            string          `json:"body"`             // Release Notes
	TarballURL      string          `json:"tarball_url"`      // https://api.github.com/repos/flintlib/flint/tarball/v3.2.2
	ZipballURL      string          `json:"zipball_url"`      // https://api.github.com/repos/flintlib/flint/zipball/v3.2.2
	Author          Author          `json:"author"`
	Assets          []*ReleaseAsset `json:"assets"`
	Prerelease      bool            `json:"prerelease"`
}

Release represents a GitHub release.

func GetRelease

func GetRelease(pkgPath, ver string) (ret *Release, err error)

GetRelease fetches the release information from GitHub.

type ReleaseAsset

type ReleaseAsset struct {
	URL                string `json:"url"`                  // https://api.github.com/repos/flintlib/flint/releases/assets/242245930
	ID                 int    `json:"id"`                   // 242245930
	NodeID             string `json:"node_id"`              // RA_kwDOAC8YHs4OcGEq
	Name               string `json:"name"`                 // flint-3.2.2.tar.gz
	ContentType        string `json:"content_type"`         // application/x-gtar
	State              string `json:"state"`                // uploaded
	Size               int64  `json:"size"`                 // 123456
	DownloadCount      int    `json:"download_count"`       // 176
	UpdatedAt          string `json:"updated_at"`           // 2025-03-31T08:54:16Z
	BrowserDownloadURL string `json:"browser_download_url"` // https://github.com/flintlib/flint/releases/download/v3.2.2/flint-3.2.2.tar.gz
}

ReleaseAsset represents a GitHub release asset.

type Tag

type Tag struct {
	Name       string `json:"name"`
	ZipballURL string `json:"zipball_url"`
	TarballURL string `json:"tarball_url"`
	Commit     Commit `json:"commit"`
	NodeID     string `json:"node_id"`
}

Tag represents a GitHub tag.

func GetTag

func GetTag(pkgPath, ver string) (tag *Tag, err error)

GetTag retrieves a specific tag from a GitHub repository.

Jump to

Keyboard shortcuts

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