github

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package github implements github utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(lg *zap.Logger, tag string, fpath string) (outputPath string, err error)

Download downloads aws-k8s-tester binary from github release.

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	ContentType        string `json:"content_type"`
	Size               uint64 `json:"size"`
	SizeString         string
	DownloadCount      int       `json:"download_count"`
	State              string    `json:"state"`
	CreatedAt          time.Time `json:"created_at"`
	CreatedAgo         string
	UpdatedAt          time.Time `json:"updated_at"`
	UpdatedAgo         string
}

Asset represents github release assets.

type Release

type Release struct {
	HTMLURL               string    `json:"html_url"`
	Name                  string    `json:"name"`
	TagName               string    `json:"tag_name"`
	Assets                []Asset   `json:"assets"`
	PublishedAt           time.Time `json:"published_at"`
	PublishedAgo          string
	TotalAssetsSize       uint64
	TotalAssetsSizeString string
}

Release represents github release.

func Query

func Query(lg *zap.Logger, tag string) (*Release, error)

Query fetches github release information. ref. https://developer.github.com/v3/repos/releases e.g.

https://api.github.com/repos/aws/aws-k8s-tester/releases/latest
https://api.github.com/repos/aws/aws-k8s-tester/releases/tags/v0.8.5

Jump to

Keyboard shortcuts

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