Documentation
¶
Overview ¶
Package apiclient provides a client for Dependabot update job API
Index ¶
Constants ¶
const (
// UserAgent is the User-Agent sent with requests
UserAgent = "dependabot-proxy/1.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for Dependabot update job API
func (*Client) ReportMetrics ¶
ReportMetrics sends metric data to the server.
func (*Client) RequestJITAccess ¶
func (c *Client) RequestJITAccess(ctx *goproxy.ProxyCtx, endpoint string, username string, password string, account string, repo string) (*config.Credential, error)
RequestJITAccess asks the API to create a token with access to the specified repository. If username and password are provided, they are used for basic auth; otherwise the client's default token is used in the Authorization header.
type ClientInterface ¶
type ClientOpt ¶
type ClientOpt func(*Client)
ClientOpt is functional configuration.
func WithCircuitBreaker ¶
WithCircuitBreaker customizes circuit breaker used by this API client.
func WithRequestBackoff ¶
WithRequestBackoff customizes the backoff used by the client
func WithTransport ¶
WithTransport customizes the HTTP transport used by the API client.
type StatusCodeError ¶
StatusCodeError is the error returned for non 2xx status code response
func (*StatusCodeError) Error ¶
func (e *StatusCodeError) Error() string
func (*StatusCodeError) IsClientError ¶
func (e *StatusCodeError) IsClientError() bool
IsClientError return true for 4xx responses
func (*StatusCodeError) IsServerError ¶
func (e *StatusCodeError) IsServerError() bool
IsServerError return true for 5xx responses