Documentation
¶
Index ¶
- Constants
- 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(url string, v interface{}) error
- func GetFileSize(f *os.File) (int64, 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
- type Asset
- type ErrNotFound
- type Release
- type ReleaseCreate
- type Tag
Constants ¶
View Source
const ( ReleaseListPath = "/repos/%s/%s/releases" ReleaseLatestPath = "/repos/%s/%s/releases/latest" )
View Source
const (
AssetDownloadURI = "/repos/%s/%s/releases/assets/%d"
)
View Source
const (
GithubAPIURL = "https://api.github.com"
)
View Source
const (
TagListPath = "/repos/%s/%s/tags"
)
Variables ¶
This section is empty.
Functions ¶
func DoAuthRequest ¶
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"`
}
type ErrNotFound ¶
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"`
}
func LatestRelease ¶
func ReleaseOfTag ¶
func (*Release) CleanUploadURL ¶
type ReleaseCreate ¶
Click to show internal directories.
Click to hide internal directories.