cloudflare

package
v0.0.0-...-e951c9a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fields

func Fields(t FieldsType) ([]string, error)

Types

type Client

type Client interface {
	LogpullReceived(ctx context.Context, start, end time.Time) (cloudflare.LogpullReceivedIterator, error)
}

Client is a wrapper around the Cloudflare API that allow for testing and being zone/fields aware.

type FieldsType

type FieldsType string
const (
	FieldsTypeDefault  FieldsType = "default"
	FieldsTypeMinimal  FieldsType = "minimal"
	FieldsTypeExtended FieldsType = "extended"
	FieldsTypeAll      FieldsType = "all"
)

type Metrics

type Metrics struct {
	Entries prometheus.Counter
	LastEnd prometheus.Gauge
	// contains filtered or unexported fields
}

Metrics holds a set of cloudflare metrics.

func NewMetrics

func NewMetrics(reg prometheus.Registerer) *Metrics

NewMetrics creates a new set of cloudflare metrics. If reg is non-nil, the metrics will be registered.

type Target

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

func NewTarget

func NewTarget(
	metrics *Metrics,
	logger log.Logger,
	handler api.EntryHandler,
	position positions.Positions,
	config *scrapeconfig.CloudflareConfig,
) (*Target, error)

func (*Target) Details

func (t *Target) Details() interface{}

func (*Target) DiscoveredLabels

func (t *Target) DiscoveredLabels() model.LabelSet

func (*Target) Labels

func (t *Target) Labels() model.LabelSet

func (*Target) Ready

func (t *Target) Ready() bool

func (*Target) Stop

func (t *Target) Stop()

func (*Target) Type

func (t *Target) Type() target.TargetType

type TargetManager

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

TargetManager manages a series of cloudflare targets.

func NewTargetManager

func NewTargetManager(
	metrics *Metrics,
	logger log.Logger,
	positions positions.Positions,
	pushClient api.EntryHandler,
	scrapeConfigs []scrapeconfig.Config,
) (*TargetManager, error)

NewTargetManager creates a new cloudflare target managers.

func (*TargetManager) ActiveTargets

func (tm *TargetManager) ActiveTargets() map[string][]target.Target

func (*TargetManager) AllTargets

func (tm *TargetManager) AllTargets() map[string][]target.Target

func (*TargetManager) Ready

func (tm *TargetManager) Ready() bool

Ready returns true if at least one cloudflare target is active.

func (*TargetManager) Stop

func (tm *TargetManager) Stop()

Jump to

Keyboard shortcuts

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