Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { ID int64 `json:"id"` Name string `json:"name"` URL string `json:"url"` BrowserDownloadURL string `json:"browserDownloadURL"` ContentType string `json:"contentType"` Size int `json:"size"` Yml *LatestYml `json:"latestYml"` }
Asset is the released package.
type GithubCache ¶
type GithubCache struct {
// contains filtered or unexported fields
}
GithubCache caches release information fetching from github.
func NewGithubCache ¶
func NewGithubCache(conf *GithubConfig, cacheDir string, proxyDownload bool, cacheURLBase string) *GithubCache
NewGithubCache .
func (*GithubCache) AssetFilePath ¶
func (g *GithubCache) AssetFilePath(release *Release, assetName string) string
AssetFilePath generates file path for caching asset.
func (*GithubCache) AssetFileURL ¶
func (g *GithubCache) AssetFileURL(release *Release, assetName string) string
AssetFileURL generates file download url of cached asset.
func (*GithubCache) LoadCache ¶
func (g *GithubCache) LoadCache() *Release
LoadCache gets latest asset info.
type GithubConfig ¶
type GithubConfig struct { Owner string `yaml:"owner"` Repo string `yaml:"repo"` Token string `yaml:"token"` }
GithubConfig of the cache
func (*GithubConfig) IsPrivateRepo ¶
func (c *GithubConfig) IsPrivateRepo() bool
IsPrivateRepo if is private repo should proxy assets download.
func (*GithubConfig) RepoURL ¶
func (c *GithubConfig) RepoURL() string
RepoURL returns repo URL on github.
type LatestYml ¶ added in v1.0.1
LatestYml stores asset update info of specific platform.
func (*LatestYml) ReplaceURL ¶ added in v1.0.1
ReplaceURL replace the url in content with proxy url.
type ProxyDownloadConfig ¶
ProxyDownloadConfig of proxy download files with current server.
type Release ¶
type Release struct { Version string `json:"version"` Notes string `json:"notes"` PubDate github.Timestamp `json:"pubDate"` Platforms map[string]*Asset `json:"platforms"` RELEASES string `json:"RELEASES"` }
Release contains major info of every release record.
type ReleaseData ¶
type ReleaseData struct { Release *Release `json:"release"` RepoURL string `json:"repoUrl"` ProxyDownload bool `json:"proxyDownload"` }
ReleaseData release info data for caching into file.