gcse: github.com/daviddengcn/gcse/spider/github Index | Files

package github

import "github.com/daviddengcn/gcse/spider/github"


Package Files

github.go utils.go


var ErrInvalidPackage = errors.New("the package is not a Go package")
var ErrInvalidRepository = errors.New("the repository is not found")
var ErrRateLimited = errors.New("Github rate limited")

type Package Uses

type Package struct {
    Name        string // package "name"
    Path        string // Relative path to the repository
    Description string
    ReadmeFn    string // No directory info
    ReadmeData  string // Raw content, cound be md, txt, etc.
    Imports     []string
    TestImports []string

type Spider Uses

type Spider struct {
    FileCache spider.FileCache
    // contains filtered or unexported fields

func NewSpiderWithContents Uses

func NewSpiderWithContents(contents map[string]string) *Spider

func NewSpiderWithToken Uses

func NewSpiderWithToken(token string) *Spider

func (*Spider) ReadPackage Uses

func (s *Spider) ReadPackage(ctx context.Context, user, repo, path string) (*Package, []*gpb.FolderInfo, error)

Even an error is returned, the folders may still contain useful elements.

func (*Spider) ReadRepo Uses

func (s *Spider) ReadRepo(ctx context.Context, user, repo, sha string, f func(path string, pkg *gpb.Package) error) error

ReadRepo reads all packages of a repository. For pkg given to f, it will not be reused. path in f is relative to the repository path.

func (*Spider) ReadRepository Uses

func (s *Spider) ReadRepository(ctx context.Context, user, name string) (*gpb.RepoInfo, error)

func (*Spider) ReadUser Uses

func (s *Spider) ReadUser(ctx context.Context, name string) (*User, error)

func (*Spider) RepoBranchSHA Uses

func (s *Spider) RepoBranchSHA(ctx context.Context, owner, repo, branch string) (sha string, err error)

func (*Spider) SearchRepositories Uses

func (s *Spider) SearchRepositories(ctx context.Context, q string) ([]github.Repository, error)

type User Uses

type User struct {
    Repos map[string]*gpb.RepoInfo

Package github imports 19 packages (graph) and is imported by 2 packages. Updated 2018-04-20. Refresh now. Tools for package owners.