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 ¶
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
Click to show internal directories.
Click to hide internal directories.