github

package
v0.0.0-...-a103e92 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: BSD-2-Clause, BSD-3-Clause Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Package

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

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

func NewSpiderWithContents

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

func NewSpiderWithToken

func NewSpiderWithToken(token string) *Spider

func (*Spider) ReadPackage

func (s *Spider) ReadPackage(user, repo, path string) (*Package, []*sppb.FolderInfo, error)

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

func (*Spider) ReadRepo

func (s *Spider) ReadRepo(user, repo, sha string, f func(path string, pkg *sppb.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

func (s *Spider) ReadRepository(user, name string) (*sppb.RepoInfo, error)

func (*Spider) ReadUser

func (s *Spider) ReadUser(name string) (*User, error)

func (*Spider) RepoBranchSHA

func (s *Spider) RepoBranchSHA(owner, repo, branch string) (sha string, err error)

func (*Spider) SearchRepositories

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

type User

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

Jump to

Keyboard shortcuts

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