client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRetryAfter

func GetRetryAfter(resp *http.Response) (time.Duration, bool)

GetRetryAfter returns Retry-After duration or false if non could be parsed.

Types

type Client

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

Client is a thin wrapper around certspotter.Client.

func NewClient

func NewClient(logger *zap.Logger, cfg *Config) *Client

NewClient returns a new client for configuration.

func (*Client) GetIssuances

GetIssuances returns issuances for options. It takes care of rate limiting and pagination.

func (*Client) SubIssuances

func (c *Client) SubIssuances(ctx context.Context, opts *certspotter.GetIssuancesOptions) <-chan []*certspotter.Issuance

SubIssuances returns a channel of issuances by subscribing to issuances for options.

type Config

type Config struct {
	// Interval used between polling for new issuances.
	Interval time.Duration
	// RateLimit used for sending certspotter api requests in Hz.
	RateLimit float64
	// Token used for certspotter api.
	Token string
	// UserAgent used for client agent header.
	UserAgent string
}

Config is used for configuring the client.

Jump to

Keyboard shortcuts

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