Documentation ¶
Index ¶
- type Client
- func (c *Client) Search(ctx context.Context, query *Query) ([]certificate.Certificate, error)
- func (c *Client) StreamSearchResults(ctx context.Context, query *Query, resultChan chan<- []certificate.Certificate) error
- func (c *Client) WithBaseURL(baseURL string) *Client
- func (c *Client) WithMaxPages(maxPages uint64) *Client
- func (c *Client) WithRetries(retries int) *Client
- func (c *Client) WithTimeout(timeout time.Duration) *Client
- type Config
- type Field
- type Query
- type Response
- type Transport
- type TransportConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API search client for certs.io
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, query *Query) ([]certificate.Certificate, error)
Search performs a search and wraps the searchWithCtx method.
func (*Client) StreamSearchResults ¶
func (c *Client) StreamSearchResults(ctx context.Context, query *Query, resultChan chan<- []certificate.Certificate) error
StreamSearchResults performs a search with a context
func (*Client) WithBaseURL ¶
WithBaseURL sets the base URL for API requests.
func (*Client) WithMaxPages ¶
WithMaxPages sets the maximum number of pages to return.
func (*Client) WithRetries ¶
WithRetries sets the maximum number of retries for API requests.
type Field ¶
type Field string
Field is a search field.
const ( // ByDomain searches for certificates by domain. ByDomain Field = "domain" // ByIP searches for certificates by IP address:port. ByServer Field = "server" // ByFingerprint searches for certificates by SHA256 fingerprint. ByFingerprint Field = "fingerprint_sha256" // ByEmail searches for certificates by email address. ByEmails Field = "emails" // ByIssuer searches for certificates by organization. ByOrg Field = "org" // BySerial searches for certificates by serial number. BySerial Field = "serial" // ByCertNames searches for certificates by common name or subject alternative name. ByCertNames Field = "ssl_names" )
type Query ¶
type Query struct { Field Field `json:"field"` Value string `json:"term"` Page uint64 `json:"page,omitempty"` }
Query is the search query for the certs.io API.
type Response ¶
type Response struct { Total uint64 `json:"total_certificates"` Pages uint64 `json:"total_pages"` CurrentPage uint64 `json:"page"` Certificates []certificate.Certificate `json:"certificates"` }
Response is the response from the certs.io API.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is the HTTP transport for the certs.io API.
func NewTransport ¶
func NewTransport(cfg TransportConfig) *Transport
NewTransport returns a new HTTP transport.
type TransportConfig ¶
type TransportConfig struct { HTTPTransport http.RoundTripper RetryBackoff func(attempt int) time.Duration MaxRetries int ApiKey string }
TransportConfig is the configuration for the HTTP transport.
Click to show internal directories.
Click to hide internal directories.