github

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RELEASE_LIST_URI    = "/repos/%s/%s/releases"
	RELEASE_LATEST_URI  = "/repos/%s/%s/releases/latest"
	RELEASE_DATE_FORMAT = "02/01/2006 at 15:04"
)

Variables

View Source
var EnvApiEndpoint = os.Getenv("GITHUB_API")
View Source
var EnvAuthUser = os.Getenv("GITHUB_AUTH_USER")
View Source
var EnvRepo = os.Getenv("GITHUB_REPO")
View Source
var EnvToken = os.Getenv("GITHUB_TOKEN")
View Source
var EnvUser = os.Getenv("GITHUB_USER")

Functions

func CloneAllRepos added in v0.34.1

func CloneAllRepos(user, token string, mirroring bool) ([]*github.Repository, error)

func DownloadLatestReleaseAssets

func DownloadLatestReleaseAssets(user, repo, authUser, token string) ([]string, error)

func DownloadReleaseAssets

func DownloadReleaseAssets(release Release) ([]string, error)

func ListAllRepos added in v0.34.1

func ListAllRepos(user, token string) ([]*github.Repository, error)

func Mirror added in v0.34.1

func Mirror(user, token string) error

Types

type Asset

type Asset struct {
	Url         string    `json:"url"`
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	ContentType string    `json:"content_type"`
	State       string    `json:"state"`
	Size        uint64    `json:"size"`
	Downloads   uint64    `json:"download_count"`
	Created     time.Time `json:"created_at"`
	Published   time.Time `json:"published_at"`
}

type Release

type Release struct {
	Url         string     `json:"url"`
	PageUrl     string     `json:"html_url"`
	UploadUrl   string     `json:"upload_url"`
	Id          int        `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"body"`
	TagName     string     `json:"tag_name"`
	Draft       bool       `json:"draft"`
	Prerelease  bool       `json:"prerelease"`
	Created     *time.Time `json:"created_at"`
	Published   *time.Time `json:"published_at"`
	Assets      []Asset    `json:"assets"`
}

func LatestRelease

func LatestRelease(user, repo, authUser, token string) (Release, error)

func Releases

func Releases(user, repo, authUser, token string) ([]Release, error)

Jump to

Keyboard shortcuts

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