{"modulePath":"github.com/vsrc/client","version":"v1.0.6-1-windows","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Constants\n\n```go\nconst (\n\tReleaseListPath   = \"/repos/%s/%s/releases\"\n\tReleaseLatestPath = \"/repos/%s/%s/releases/latest\"\n)\n```\n\n```go\nconst (\n\tAssetDownloadURI = \"/repos/%s/%s/releases/assets/%d\"\n)\n```\n\n```go\nconst (\n\tGithubAPIURL = \"https://api.github.com\"\n)\n```\n\n```go\nconst (\n\tTagListPath = \"/repos/%s/%s/tags\"\n)\n```\n\n## Functions\n\n```go\nfunc CreateRelease(token string, repo string, tag string, name string) error\n```\n\n```go\nfunc DoAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Response, error)\n```\n\n```go\nfunc Download(token string, url string, name string) error\n```\n\n```go\nfunc DownloadAsset(token string, repo string, tag string, name string) error\n```\n\n```go\nfunc DownloadSource(token string, repo string, tag string) error\n```\n\n```go\nfunc Get(url string, v interface{}) error\n```\n\n```go\nfunc GetFileSize(f *os.File) (int64, error)\n```\n\n```go\nfunc NewAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Request, error)\n```\nNewAuthRequest creates a new request that sends the auth token\n\n```go\nfunc Upload(token string, repo string, tag string, name string, file string) error\n```\n\n## Types\n\n```go\ntype Asset struct {\n\tURL                string    `json:\"url\"`\n\tID                 int       `json:\"id\"`\n\tName               string    `json:\"name\"`\n\tContentType        string    `json:\"content_type\"`\n\tState              string    `json:\"state\"`\n\tSize               uint64    `json:\"size\"`\n\tDownloads          uint64    `json:\"download_count\"`\n\tCreated            time.Time `json:\"created_at\"`\n\tPublished          time.Time `json:\"published_at\"`\n\tBrowserDownloadURL string    `json:\"browser_download_url\"`\n}\n```\n\n```go\ntype ErrNotFound struct {\n\tName  string\n\tKey   string\n\tValue string\n}\n```\n\n```go\nfunc (e ErrNotFound) Error() string\n```\n\n```go\ntype Release struct {\n\tURL         string     `json:\"url\"`\n\tPageURL     string     `json:\"html_url\"`\n\tUploadURL   string     `json:\"upload_url\"`\n\tID          int        `json:\"id\"`\n\tName        string     `json:\"name\"`\n\tDescription string     `json:\"body\"`\n\tTagName     string     `json:\"tag_name\"`\n\tDraft       bool       `json:\"draft\"`\n\tPrerelease  bool       `json:\"prerelease\"`\n\tCreated     *time.Time `json:\"created_at\"`\n\tPublished   *time.Time `json:\"published_at\"`\n\tAssets      []Asset    `json:\"assets\"`\n}\n```\n\n```go\nfunc LatestRelease(user, repo, token string) (release *Release, err error)\n```\n\n```go\nfunc ReleaseOfTag(user, repo, tag, token string) (*Release, error)\n```\n\n```go\nfunc Releases(user, repo, token string) (releases []Release, err error)\n```\n\n```go\nfunc (r *Release) CleanUploadURL() string\n```\n\n```go\ntype ReleaseCreate struct {\n\tTagName         string `json:\"tag_name\"`\n\tTargetCommitish string `json:\"target_commitish,omitempty\"`\n\tName            string `json:\"name\"`\n\tBody            string `json:\"body\"`\n\tDraft           bool   `json:\"draft\"`\n\tPrerelease      bool   `json:\"prerelease\"`\n}\n```\n\n```go\ntype Tag struct {\n\tName string `json:\"name\"`\n}\n```\n\n```go\nfunc LatestTag(user, repo, token string) (tag *Tag, err error)\n```\n\n```go\nfunc Tags(user, repo, token string) (tags []Tag, err error)\n```\n\n","path":"github.com/vsrc/client/go/tools/release/github","name":"github","synopsis":"","isRedistributable":true}
