githubsearch

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONST_REPO  = "repo"
	CONST_REPOS = "repos"
	CONST_ORGS  = "organizations"
	CONST_USER  = "user"
)

Variables

View Source
var (
	SEARCH_NUM = 25
)

Functions

func BuildQuery

func BuildQuery(query string) (string, error)

func GenerateSearchCodeTask

func GenerateSearchCodeTask() (map[int][]models.Rule, error)

func GetGithubUserInfo

func GetGithubUserInfo(client *Client, ownerName *string) *github.User

func InitGithubClients

func InitGithubClients() (map[string]*Client, error)

func InsertAllRepos

func InsertAllRepos()

func PassFilters

func PassFilters(codeResult *models.CodeResult, fullName string) bool

The filters are utilized to filter the codeResult

func RunSearchTask

func RunSearchTask(mapRules map[int][]models.Rule, err error)

func SaveResult

func SaveResult(results []*github.CodeSearchResult, err error, keyword *string)

func ScheduleTasks

func ScheduleTasks(duration time.Duration)
func Search(rules []models.Rule)

Types

type Client

type Client struct {
	Client *github.Client
	Token  string
}
var (
	GithubClients map[string]*Client
	GithubClient  *Client
)

func GetGithubClient

func GetGithubClient() (*Client, string, error)

func NewGitClient

func NewGitClient(GithubClient *github.Client, token string) *Client

func (*Client) GetOrgsMembers

func (c *Client) GetOrgsMembers(org string) ([]*github.User, *github.Response, error)

func (*Client) GetOrgsRepos

func (c *Client) GetOrgsRepos(org string) ([]*github.Repository, *github.Response, error)

func (*Client) GetStrUsersRepos

func (c *Client) GetStrUsersRepos(users []string) map[string][]*github.Repository

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(username string) (*github.User, *github.Response, error)

func (*Client) GetUserOrgs

func (c *Client) GetUserOrgs(username string) ([]*github.Organization, *github.Response, error)

func (*Client) GetUserRepos

func (c *Client) GetUserRepos(username string) ([]*github.Repository, *github.Response, error)

func (*Client) GetUsersRepos

func (c *Client) GetUsersRepos(users []*github.User) map[string][]*github.Repository

func (*Client) SearchCode

func (c *Client) SearchCode(keyword string) ([]*github.CodeSearchResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL