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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultURL is the default base url for the scorecard API
	DefaultURL = "https://api.securityscorecards.dev"

	// DefaultTimeout is the default timeout for HTTP requests
	DefaultTimeout = time.Second * 30
)
View Source
const ClientName = "api"

ClientName is the name of the client

Variables

This section is empty.

Functions

func NewClient

func NewClient(rawURL string, opts ...Option) (scorecard.Client, error)

NewClient returns a client that fetches scores from the scorecard API

Types

type Client

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

Client retrieves scores from the scorecard API

func (*Client) GetResult

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

GetResult fetches a scorecard result from the public scorecard API

func (*Client) Name

func (c *Client) Name() string

Name returns the client name

type Option

type Option func(c *Client)

Option is a functional option that configures the scorecard API client

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout is a functional option that configures the timeout duration for HTTP requests

Jump to

Keyboard shortcuts

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