github

package
v0.34.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 14 Imported by: 0

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