provider

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewArtifactoryMetricsFetcher

func NewArtifactoryMetricsFetcher(rtDetails *config.ServerDetails) (*artifactoryMetricsFetcher, error)

func NewUrlMetricsFetcher

func NewUrlMetricsFetcher(url string, authenticator Authenticator) *urlMetricsFetcher

Types

type AccessTokenAuthenticator

type AccessTokenAuthenticator struct {
	Token string
}

func (AccessTokenAuthenticator) Authorize

func (a AccessTokenAuthenticator) Authorize(req *http.Request)

func (AccessTokenAuthenticator) String

func (a AccessTokenAuthenticator) String() string

type Authenticator

type Authenticator interface {
	Authorize(req *http.Request)
}

type Config

type Config interface {
	UrlMetricsFetcher() UrlMetricsFetcher
	File() string
	Interval() time.Duration
	TimeWindow() time.Duration
	Filter() *regexp.Regexp
	AggregateIgnoreLabels() StringSet
}

type MetricsCache

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

func NewMetricsCache

func NewMetricsCache(timeWindow time.Duration) *MetricsCache

func (*MetricsCache) Add

func (m *MetricsCache) Add(metricsCollection []models.Metrics) []models.Metrics

type MetricsFilterFunc

type MetricsFilterFunc func(metrics models.Metrics) bool

func NewRegexMetricsFilter

func NewRegexMetricsFilter(regex *regexp.Regexp) MetricsFilterFunc

type MetricsMapperFunc

type MetricsMapperFunc func(metricsCollection []models.Metrics) []models.Metrics

func NewLabelsMetricsMapper

func NewLabelsMetricsMapper(ignoredLabels StringSet, delim string) MetricsMapperFunc

type Provider

type Provider interface {
	Get() ([]models.Metrics, error)
}

func New

func New(c Config) (Provider, error)

type StringSet

type StringSet map[string]struct{}

func (*StringSet) Add

func (s *StringSet) Add(values ...string)

func (StringSet) Contains

func (s StringSet) Contains(v string) bool

func (StringSet) Len

func (s StringSet) Len() int

type UrlMetricsFetcher

type UrlMetricsFetcher interface {
	Get() ([]byte, error)
}

type UserPassAuthenticator

type UserPassAuthenticator struct {
	Username string
	Password string
}

func (UserPassAuthenticator) Authorize

func (a UserPassAuthenticator) Authorize(req *http.Request)

func (UserPassAuthenticator) String

func (a UserPassAuthenticator) String() string

Jump to

Keyboard shortcuts

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