Documentation
¶
Index ¶
- Constants
- Variables
- func DumpJson(data interface{}) error
- func DumpLauncher(ranks Ranks, location *string) error
- func DumpMarkdown(ranks Ranks, location *string) error
- func F2Base64(path string) (string, error)
- func GHPublisher(token string, publish *string, branch string, author Committer) error
- func GetAPIKey() (key string, err error)
- func GetKey(path string) (string, error)
- func GetTags(userid int, key string, offline bool) string
- func GetToken() (token string)
- func GetUserInfo(users *SOUsers, min int, location *regexp.Regexp, counter *int, limit int, ...) bool
- func GitHubConnector(fmtpath string, target string, token string, branch string, author Committer) error
- func Init(traceHandle io.Writer, infoHandle io.Writer, warningHandle io.Writer, ...)
- func JSONDecoder(r io.Reader, data interface{}) error
- func JSONEncoder(data interface{}) (buf io.ReadWriter, err error)
- func StreamFile(jsonfile string, data interface{}) error
- func StreamHTTP(url string, data interface{}, gzipped bool) error
- type Committer
- type Create
- type GHReqError
- type GitHubUpdatePut
- type GitHubUpdateRsp
- type Ranks
- type Repo
- type SOTopTags
- type SOUserRank
- type SOUsers
- type Update
Constants ¶
View Source
const ( RspMDPath = "../_temp/ranks.md" RspJSONPath = "../_temp/ranks.json" APIKeyPath = "../_secret/api.key" GitHubToken = "../_secret/token" SOApiURL = "https://api.stackexchange.com/2.2" SOUsersQuery = `users?page=%d&pagesize=100&order=desc&sort=reputation&site=stackoverflow` SOUserTags = `users/%d/top-answer-tags?page=1&pagesize=3&site=stackoverflow` GHApiURL = "https://api.github.com/repos/klashxx/soranks" )
Variables ¶
Functions ¶
func DumpLauncher ¶
func DumpMarkdown ¶
func GHPublisher ¶
func GetUserInfo ¶
func GitHubConnector ¶
func JSONDecoder ¶
func JSONEncoder ¶
func JSONEncoder(data interface{}) (buf io.ReadWriter, err error)
func StreamFile ¶
func StreamHTTP ¶
Types ¶
type GHReqError ¶
type GitHubUpdatePut ¶
type GitHubUpdateRsp ¶
type GitHubUpdateRsp struct {
Content struct {
Name string `json:"name"`
Path string `json:"path"`
Sha string `json:"sha"`
Size int `json:"size"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
GitURL string `json:"git_url"`
DownloadURL string `json:"download_url"`
Type string `json:"type"`
Links struct {
Self string `json:"self"`
Git string `json:"git"`
HTML string `json:"html"`
} `json:"_links"`
} `json:"content"`
Commit struct {
Sha string `json:"sha"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
Author struct {
Date time.Time `json:"date"`
Name string `json:"name"`
Email string `json:"email"`
} `json:"author"`
Committer struct {
Date time.Time `json:"date"`
Name string `json:"name"`
Email string `json:"email"`
} `json:"committer"`
Message string `json:"message"`
Tree struct {
URL string `json:"url"`
Sha string `json:"sha"`
} `json:"tree"`
Parents []struct {
URL string `json:"url"`
HTMLURL string `json:"html_url"`
Sha string `json:"sha"`
} `json:"parents"`
} `json:"commit"`
}
type Ranks ¶
type Ranks []SOUserRank
type SOTopTags ¶
type SOTopTags struct {
Items []struct {
UserID int `json:"user_id"`
AnswerCount int `json:"answer_count"`
AnswerScore int `json:"answer_score"`
QuestionCount int `json:"question_count"`
QuestionScore int `json:"question_score"`
TagName string `json:"tag_name"`
} `json:"items"`
HasMore bool `json:"has_more"`
QuotaMax int `json:"quota_max"`
QuotaRemaining int `json:"quota_remaining"`
}
type SOUserRank ¶
type SOUserRank struct {
Rank int `json:"rank"`
AccountID int `json:"account_id"`
DisplayName string `json:"display_name"`
Reputation int `json:"reputation"`
Location string `json:"location,omitempty"`
WebsiteURL string `json:"website_url,omitempty"`
Link string `json:"link"`
ProfileImage string `json:"profile_image"`
TopTags string `json:"top_tags"`
}
type SOUsers ¶
type SOUsers struct {
Items []struct {
BadgeCounts struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
} `json:"badge_counts"`
AccountID int `json:"account_id"`
IsEmployee bool `json:"is_employee"`
LastModifiedDate int `json:"last_modified_date"`
LastAccessDate int `json:"last_access_date"`
Age int `json:"age,omitempty"`
ReputationChangeYear int `json:"reputation_change_year"`
ReputationChangeQuarter int `json:"reputation_change_quarter"`
ReputationChangeMonth int `json:"reputation_change_month"`
ReputationChangeWeek int `json:"reputation_change_week"`
ReputationChangeDay int `json:"reputation_change_day"`
Reputation int `json:"reputation"`
CreationDate int `json:"creation_date"`
UserType string `json:"user_type"`
UserID int `json:"user_id"`
AcceptRate int `json:"accept_rate,omitempty"`
Location string `json:"location,omitempty"`
WebsiteURL string `json:"website_url,omitempty"`
Link string `json:"link"`
ProfileImage string `json:"profile_image"`
DisplayName string `json:"display_name"`
} `json:"items"`
HasMore bool `json:"has_more"`
QuotaMax int `json:"quota_max"`
QuotaRemaining int `json:"quota_remaining"`
}
Click to show internal directories.
Click to hide internal directories.