Documentation ¶
Index ¶
- func CIStatuses(token string, repo string, commit string) error
- func CreateRelease(token string, repo string, tag string, name string) error
- func DoAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Response, error)
- func Download(token string, url string, name string) error
- func DownloadAsset(token string, repo string, tag string, name string) error
- func DownloadSource(token string, repo string, tag string) error
- func Get(token string, url string, v interface{}) error
- func NewAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Request, error)
- func Upload(token string, repo string, tag string, name string, file string) error
- func WaitForCI(token string, repo string, commit string, contexts []string, ...) error
- type Asset
- type Commit
- type ErrNotFound
- type Release
- type ReleaseCreate
- type Status
- type Statuses
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CIStatuses ¶
CIStatuses lists statuses for CI
func CreateRelease ¶
CreateRelease creates a release for a tag
func DoAuthRequest ¶
func DoAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Response, error)
DoAuthRequest does an authenticated request to Github
func DownloadAsset ¶
DownloadAsset downloads an asset from Github that matches name
func DownloadSource ¶
DownloadSource dowloads source from repo tag
func NewAuthRequest ¶
func NewAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Request, error)
NewAuthRequest creates a new request that sends the auth token
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"` BrowserDownloadURL string `json:"browser_download_url"` }
Asset is a Github API Asset
type Commit ¶
type Commit struct {
SHA string `json:"sha"`
}
Commit defines a git commit on Github
type ErrNotFound ¶
ErrNotFound is error type for not found in API
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
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"` }
Release is a Github API Release type
func LatestRelease ¶
LatestRelease returns latest release for repo
func ReleaseOfTag ¶
ReleaseOfTag returns release for tag
func (*Release) CleanUploadURL ¶
CleanUploadURL is URL for uploading a release
type ReleaseCreate ¶
type ReleaseCreate struct { TagName string `json:"tag_name"` TargetCommitish string `json:"target_commitish,omitempty"` Name string `json:"name"` Body string `json:"body"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` }
ReleaseCreate is a Github API ReleaseCreate type
Click to show internal directories.
Click to hide internal directories.