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: 0

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