collector

package
v0.0.0-...-397a539 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFQName

func BuildFQName(name string, logger *slog.Logger) string

Types

type ExporterCollector

type ExporterCollector struct {
	StartTime *prometheus.Desc
	BuildInfo *prometheus.Desc
	// contains filtered or unexported fields
}

ExporterCollector collects metrics, mostly runtime, about this exporter in general.

func NewExporterCollector

func NewExporterCollector(osVersion, goVersion, gitCommit string, startTime int64) *ExporterCollector

NewExporterCollector is a function that returns a new ExporterCollector.

func (*ExporterCollector) Collect

func (c *ExporterCollector) Collect(ch chan<- prometheus.Metric)

Collect implements Prometheus' Collector interface and is used to collect metrics

func (*ExporterCollector) Describe

func (c *ExporterCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements Prometheus' Collector interface and is used to describe metrics

type HostsCollector

type HostsCollector struct {

	// Metrics
	CertificateRecords *prometheus.Desc
	CertificateExpiry  *prometheus.Desc
	// contains filtered or unexported fields
}

HostsCollector is a type that represents a collector of host records

func NewHostsCollector

func NewHostsCollector(hosts []string, log *slog.Logger) *HostsCollector

NewHostsCollector is a function that returns a new HostCollector

func (*HostsCollector) Collect

func (c *HostsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements Prometheus' Collector interface and is used to collect metrics

func (*HostsCollector) Describe

func (c *HostsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements Prometheus' Collector interface and is used to describe metrics

type Record

type Record struct {
	IssueCAID      int    `json:"issuer_ca_id"`
	IssuerName     string `json:"issuer_name"`
	CommonName     string `json:"common_name"`
	NameValue      string `json:"name_value"`
	ID             int    `json:"id"`
	EntryTimestamp Time   `json:"entry_timestamp"`
	NotBefore      Time   `json:"not_before"`
	NotAfter       Time   `json:"not_after"`
	SerialNumber   string `json:"serial_number"`
}

Record is a type that represents a crt.sh result record

type Time

type Time struct {
	time.Time
}

Time provides an alternative JSON unmarshaler for string-encoded dates Dates are returned either as 2006-01-02T15:04:05.999 or without milliseconds

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON is a method that converts a string-encoded date into a Time

Jump to

Keyboard shortcuts

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