shared

package
v1.6.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcurrentUpload

func ConcurrentUpload(httpClient *http.Client, uploadURL string, numWorkers int, assets []*AssetForUpload) error

Types

type AssetForUpload

type AssetForUpload struct {
	Name  string
	Label string

	Size     int64
	MIMEType string
	Open     func() (io.ReadCloser, error)

	ExistingURL string
}

func AssetsFromArgs

func AssetsFromArgs(args []string) (assets []*AssetForUpload, err error)

type Release

type Release struct {
	TagName      string    `json:"tag_name"`
	Name         string    `json:"name"`
	Body         string    `json:"body"`
	IsDraft      bool      `json:"draft"`
	IsPrerelease bool      `json:"prerelease"`
	CreatedAt    time.Time `json:"created_at"`
	PublishedAt  time.Time `json:"published_at"`

	APIURL    string `json:"url"`
	UploadURL string `json:"upload_url"`
	HTMLURL   string `json:"html_url"`
	Assets    []ReleaseAsset

	Author struct {
		Login string
	}
}

func FetchLatestRelease

func FetchLatestRelease(httpClient *http.Client, baseRepo ghrepo.Interface) (*Release, error)

FetchLatestRelease finds the latest published release for a repository.

func FetchRelease

func FetchRelease(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string) (*Release, error)

FetchRelease finds a repository release by its tagName.

func FindDraftRelease

func FindDraftRelease(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string) (*Release, error)

FindDraftRelease returns the latest draft release that matches tagName.

type ReleaseAsset

type ReleaseAsset struct {
	Name   string
	Size   int64
	State  string
	APIURL string `json:"url"`
}

Jump to

Keyboard shortcuts

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