scorecard

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ScorecardClientName = "scorecard"

ScorecardClientName is the name of the scorecard client

Variables

View Source
var (
	// ErrNotFound is returned by the client when it can't find a score for the
	// repository
	ErrNotFound = errors.New("score not found")

	// ErrUnexpectedResponse is returned when a scorecard client gets an unexpected
	// response from its upstream source
	ErrUnexpectedResponse = errors.New("unexpected response")

	// ErrInvalidRepository is returned when an invalid repository is
	// provided as input
	ErrInvalidRepository = errors.New("invalid repository")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetResult retrieves a scorecard result for the given platform, org
	// and repo
	GetResult(ctx context.Context, repository string) (*models.ScorecardResult, error)

	// Name returns the name of this client
	Name() string
}

Client fetches scorecard results for repositories

func NewScorecardClient

func NewScorecardClient() (Client, error)

NewScorecardClient returns a new client that generates scores itself for repositories

type ScorecardClient

type ScorecardClient struct{}

ScorecardClient generates scorecard scores for repositories

func (*ScorecardClient) GetResult

func (c *ScorecardClient) GetResult(ctx context.Context, repository string) (*models.ScorecardResult, error)

GetResult generates a scorecard result with the scorecard client

func (*ScorecardClient) Name

func (c *ScorecardClient) Name() string

Name is the name of the client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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