Documentation ¶
Index ¶
- Variables
- func Auth(username, password string) (bool, string, error)
- func CancelReportById(id int64) (page int, err error)
- func CancelReportsByRepo(id int64) (err error)
- func ChangeReportsStatusByRepo(id int64, status int) (err error)
- func ConfirmAppResult(id int64) (err error)
- func ConfirmResultById(id int64) (err error)
- func ConvertRuleType(id int64) (err error)
- func DeleteAdminById(id int64) error
- func DeleteAllInputInfo() error
- func DeleteAllRepos() error
- func DeleteFilterRuleById(id int64) (err error)
- func DeleteInputInfoById(id int64) error
- func DeleteRulesById(id int64) (err error)
- func DeleteTokenById(id int64) error
- func DisableRepoById(id int64) error
- func DisableRepoByUrl(repoUrl string) error
- func DisableRulesById(id int64) (err error)
- func EditAdminById(id int64, username, password, role string) error
- func EditFilterRuleById(id int64, ruleType int, ruleKey, ruleValue string) error
- func EditInputInfoById(id int64, inputType, content, desc string) error
- func EditRuleById(id int64, position, ruleType, pat, caption, desc string, status int) error
- func EditTokenById(id int64, token, desc string) error
- func EnableRepoById(id int64) error
- func EnableRulesById(id int64) (err error)
- func GetPageById(id int64) (int, error)
- func IgnoreAppSearchResult(id int64) (err error)
- func InitAdmin()
- func InitRules()
- func InsertBlacklistRules(filename string) error
- func InsertRules(filename string) error
- func NewDbEngine() (err error)
- func UpdateRate(token string, response *github.Response) error
- type Admin
- type AppSearchResult
- type CodeResult
- type CodeResultDetail
- type CodeSearchResult
- type FilterRule
- func GetFilterRuleById(id int64) (*FilterRule, bool, error)
- func GetFilterRules() ([]FilterRule, error)
- func GetFilterRulesPage(page int) ([]FilterRule, int, error)
- func LoadBlackListRuleFromFile(filename string) ([]FilterRule, error)
- func NewFilterRule(ruleType int, ruleKey, ruleValue string) *FilterRule
- type GithubToken
- type InputInfo
- type Match
- type MatchedText
- type Repo
- type Rule
- func GetRuleById(id int64) (*Rule, bool, error)
- func GetRules() ([]Rule, error)
- func GetRulesPage(page int) ([]Rule, int, error)
- func GetValidRules() ([]Rule, error)
- func GetValidRulesByType(Type string) ([]Rule, error)
- func LoadRuleFromFile(filename string) ([]Rule, error)
- func NewRule(ruleType, pat, caption, pos, desc string, status int) *Rule
- type TextMatch
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CancelReportById ¶
func CancelReportsByRepo ¶
func ConfirmAppResult ¶
func ConfirmResultById ¶
confirm the whole repository by id
func ConvertRuleType ¶
func DeleteAdminById ¶
func DeleteAllInputInfo ¶
func DeleteAllInputInfo() error
func DeleteAllRepos ¶
func DeleteAllRepos() error
func DeleteFilterRuleById ¶
func DeleteInputInfoById ¶
func DeleteRulesById ¶
func DeleteTokenById ¶
func DisableRepoById ¶
func DisableRepoByUrl ¶
func DisableRulesById ¶
func EditAdminById ¶
func EditFilterRuleById ¶
func EditInputInfoById ¶
func EditRuleById ¶
func EditTokenById ¶
func EnableRepoById ¶
func EnableRulesById ¶
func GetPageById ¶
func IgnoreAppSearchResult ¶
func InsertBlacklistRules ¶
func InsertRules ¶
Types ¶
type Admin ¶
func ListAdmins ¶
type AppSearchResult ¶
type AppSearchResult struct { Id int64 Name *string `json:"name,omitempty"` Description *string Market *string `json:"market,omitempty"` Developer *string Version *string DeployDate *string AppUrl *string Status int CreatedTime time.Time `xorm:"created"` UpdatedTime time.Time `xorm:"updated"` }
AppSearchResult represents a single search result for app market search
func ListAppSearchResultByPage ¶
func ListAppSearchResultByPage(page int, status int) ([]AppSearchResult, int, int)
func (*AppSearchResult) Exist ¶
func (r *AppSearchResult) Exist() (bool, error)
func (*AppSearchResult) Insert ¶
func (r *AppSearchResult) Insert() (int64, error)
type CodeResult ¶
type CodeResult struct { Id int64 Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` RepoName string SHA *string `json:"sha,omitempty" xorm:"sha"` HTMLURL *string `json:"html_url,omitempty" xorm:"html_url"` Repository *github.Repository `json:"repository,omitempty" xorm:"json"` TextMatches []TextMatch `json:"text_matches,omitempty" xorm:"LONGBLOB"` Status int // 1 confirmed 2 ignored Version int `xorm:"version"` CreatedTime time.Time `xorm:"created"` UpdatedTime time.Time `xorm:"updated"` RepoPath *string Keyword *string Score float32 }
CodeResult represents a single search result.
func GetReportById ¶
func GetReportById(id int64, omitRepo bool) (bool, *CodeResult, error)
func ListGithubSearchResultPage ¶
func ListGithubSearchResultPage(page int, status int) ([]CodeResult, int, int)
func (*CodeResult) Exist ¶
func (r *CodeResult) Exist() (bool, error)
func (*CodeResult) Insert ¶
func (r *CodeResult) Insert() (int64, error)
type CodeResultDetail ¶
type CodeResultDetail struct { Id int64 // owner OwnerName *string OwnerURl *string Company *string Location *string Email *string Blog *string OwnerCreatedAt string Type *string // repo RepoName *string RepoUrl *string Lang *string Keyword *string RepoCreatedAt *github.Timestamp RepoUpdatedAt *github.Timestamp Status int MatchedTexts []TextMatch }
func GetCodeResultDetailById ¶
func GetCodeResultDetailById(id int64) (*CodeResultDetail, error)
type CodeSearchResult ¶
type CodeSearchResult struct { Total *int `json:"total_count,omitempty"` IncompleteResults *bool `json:"incomplete_results,omitempty"` CodeResults []CodeResult `json:"items,omitempty" xorm:"json"` }
CodeSearchResult represents the result of a code search.
type FilterRule ¶
type FilterRule struct { Id int64 RuleType int // 0: blacklist rule, 1: whitelist rule RuleKey string RuleValue string `xorm:"text"` }
func GetFilterRuleById ¶
func GetFilterRuleById(id int64) (*FilterRule, bool, error)
func GetFilterRules ¶
func GetFilterRules() ([]FilterRule, error)
func GetFilterRulesPage ¶
func GetFilterRulesPage(page int) ([]FilterRule, int, error)
func LoadBlackListRuleFromFile ¶
func LoadBlackListRuleFromFile(filename string) ([]FilterRule, error)
func NewFilterRule ¶
func NewFilterRule(ruleType int, ruleKey, ruleValue string) *FilterRule
func (*FilterRule) Insert ¶
func (r *FilterRule) Insert() (err error)
type GithubToken ¶
type GithubToken struct { Id int64 Token string Desc string // The number of requests per hour the client is currently limited to. Limit int `json:"limit"` // The number of remaining requests the client can make this hour. Remaining int `xorm:"default 5000 notnull" json:"remaining"` // The time at which the current rate limit will reset. Reset time.Time `json:"reset"` }
func GetTokenById ¶
func GetTokenById(id int64) (*GithubToken, bool, error)
func ListTokens ¶
func ListTokens() ([]GithubToken, error)
func ListValidTokens ¶
func ListValidTokens() ([]GithubToken, error)
func NewGithubToken ¶
func NewGithubToken(token, desc string) *GithubToken
create a GithubToken with limit and remain
func (*GithubToken) Exist ¶
func (g *GithubToken) Exist() (bool, error)
detect if the GithubToken exists
func (*GithubToken) Insert ¶
func (g *GithubToken) Insert() (int64, error)
insert a GithubToken into database
type InputInfo ¶
type InputInfo struct { Id int64 Type string `xorm:"varchar(255) notnull"` Content string `xorm:"text notnull"` Desc string `xorm:"text notnull"` Developer string `xorm:"text"` Version int `xorm:"version"` CreatedTime time.Time `xorm:"created"` UpdatedTime time.Time `xorm:"updated"` }
func ListInputInfo ¶
func NewInputInfo ¶
type MatchedText ¶
type Repo ¶
func ListEnableRepos ¶
type Rule ¶
type Rule struct { Id int64 Position string Type string Pattern string Caption string Description string `xorm:"text"` Status int `xorm:"int default 0 notnull"` }
func GetValidRules ¶
func GetValidRulesByType ¶
func LoadRuleFromFile ¶
type TextMatch ¶
type TextMatch struct { Id int64 ObjectURL *string `json:"object_url,omitempty"` ObjectType *string `json:"object_type,omitempty"` Property *string `json:"property,omitempty"` Fragment *string `json:"fragment,omitempty"` Matches []Match `xorm:"LONGBLOB"` }
TextMatch represents a text match for a SearchResult
func GetMatchedTexts ¶
Click to show internal directories.
Click to hide internal directories.