Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_INTERVAL = int(60 * 24 * 30)
View Source
var DefaultCachePath = os.Getenv("HOME") + "/.local/share/uacache"
View Source
var UA_STAT_URL = "https://raw.githubusercontent.com/Kikobeats/top-user-agents/master/index.json"
This is really bad data as it's very bias, but I am just looking for latest stats at a certain percentage that can prevent staleness detection. I'd like a much better data source
View Source
var UA_URL = "https://omahaproxy.appspot.com/json"
var DEFAULT_INTERVAL = int(10)
Functions ¶
func GetCurrentUA ¶
func SaveUACache ¶
Types ¶
type ChromeRelease ¶
type ChromeRelease []struct { Os string `json:"os"` Versions []struct { BranchCommit string `json:"branch_commit"` BranchBasePosition string `json:"branch_base_position"` SkiaCommit string `json:"skia_commit"` V8Version string `json:"v8_version"` PreviousVersion string `json:"previous_version"` V8Commit string `json:"v8_commit"` TrueBranch string `json:"true_branch"` PreviousReldate string `json:"previous_reldate"` BranchBaseCommit string `json:"branch_base_commit"` Version string `json:"version"` CurrentReldate string `json:"current_reldate"` CurrentVersion string `json:"current_version"` Os string `json:"os"` Channel string `json:"channel"` ChromiumCommit string `json:"chromium_commit"` } `json:"versions"` }
type CommonAgents ¶
type CommonAgents []string
func GetCommonUA ¶
func GetCommonUA() (CommonAgents, error)
type UserAgentCache ¶
type UserAgentCache struct { LastUpdate int Interval int LatestUserAgent string CommonUserAgents []string }
func GetUACache ¶
func GetUACache(file string) (UserAgentCache, error)
Click to show internal directories.
Click to hide internal directories.