scanner

package
v4.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPubliccodeNotFound = errors.New("publiccode.yml not found")

Functions

This section is empty.

Types

type BitBucketScanner

type BitBucketScanner struct {
	// contains filtered or unexported fields
}

func (BitBucketScanner) ScanGroupOfRepos

func (scanner BitBucketScanner) ScanGroupOfRepos(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

RegisterBitbucketAPI register the crawler function for Bitbucket API.

func (BitBucketScanner) ScanRepo

func (scanner BitBucketScanner) ScanRepo(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

RegisterSingleBitbucketAPI register the crawler function for single Bitbucket repository.

type GitHubScanner

type GitHubScanner struct {
	// contains filtered or unexported fields
}

func (GitHubScanner) ScanGroupOfRepos

func (scanner GitHubScanner) ScanGroupOfRepos(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

ScanGroupOfRepos scans a GitHub organization represented by url, associated to publisher and sends any repository containing a publiccode.yml to the repositories channel as a common.Repository. It returns any error encountered if any, otherwise nil.

func (GitHubScanner) ScanRepo

func (scanner GitHubScanner) ScanRepo(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

ScanRepo scans a GitHub repository represented by url, associated to publisher and, if it contains a publiccode.yml, sends it as a common.Repository repositories channel. It returns any error encountered if any, otherwise nil.

type GitLabScanner

type GitLabScanner struct{}

func (GitLabScanner) ScanGroupOfRepos

func (scanner GitLabScanner) ScanGroupOfRepos(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

RegisterGitlabAPI register the crawler function for Gitlab API.

func (GitLabScanner) ScanRepo

func (scanner GitLabScanner) ScanRepo(
	url url.URL, publisher common.Publisher, repositories chan common.Repository,
) error

RegisterSingleGitlabAPI register the crawler function for single Bitbucket API.

type Scanner

type Scanner interface {
	ScanRepo(url url.URL, publisher common.Publisher, repositories chan common.Repository) error
	ScanGroupOfRepos(url url.URL, publisher common.Publisher, repositories chan common.Repository) error
}

func NewBitBucketScanner

func NewBitBucketScanner() Scanner

func NewGitHubScanner

func NewGitHubScanner() Scanner

NewGitHubScanner returns a new GitHubScanner using the authentication token from the GITHUB_TOKEN environment variable or, if not set, the tokens in domains.yml.

func NewGitLabScanner

func NewGitLabScanner() Scanner

Jump to

Keyboard shortcuts

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