testing

package
Version: v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Code generated for package testing by go-bindata DO NOT EDIT. (@generated) sources: certs/metric-store-ca.crl certs/metric-store-ca.crt certs/metric-store-ca.key certs/metric-store.crt certs/metric-store.csr certs/metric-store.key

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func BuildExpectedLog

func BuildExpectedLog(timestamp time.Time, requestId, method, path, sourceHost, sourcePort, dstHost, dstPort string) string

func BuildRequest

func BuildRequest(method, url, remoteAddr, requestId, forwardedFor string) *http.Request

func Cert

func Cert(filename string) string

func FormatTimeWithDecimalMillis

func FormatTimeWithDecimalMillis(t time.Time) string

func GetFreePort

func GetFreePort() int

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func MutualTLSClientConfig

func MutualTLSClientConfig() *tls.Config

func MutualTLSServerConfig

func MutualTLSServerConfig() *tls.Config

func NewQueryEngine

func NewQueryEngine() *promql.Engine

func NewServerRequest

func NewServerRequest(method, uri string, body io.Reader) (*http.Request, error)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SkipTestOnMac

func SkipTestOnMac()

func StartGoProcess

func StartGoProcess(importPath string, env []string, args ...string) *gexec.Session

func WaitForHealthCheck

func WaitForHealthCheck(profilingAddr string, tlsConfig *tls.Config)

Types

type AlertManagerSpy

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

func NewAlertManagerSpy

func NewAlertManagerSpy(tlsConfig *tls.Config) *AlertManagerSpy

func (*AlertManagerSpy) Addr

func (a *AlertManagerSpy) Addr() string

func (*AlertManagerSpy) AlertsReceived

func (a *AlertManagerSpy) AlertsReceived() int64

func (*AlertManagerSpy) LastAlertReceived

func (a *AlertManagerSpy) LastAlertReceived() string

func (*AlertManagerSpy) Start

func (a *AlertManagerSpy) Start()

func (*AlertManagerSpy) Stop

func (a *AlertManagerSpy) Stop()

type MockAuthClient

type MockAuthClient struct {
	Calls atomic.Int32
}

func (*MockAuthClient) GetAuthHeader

func (m *MockAuthClient) GetAuthHeader() (string, error)

type Point

type Point struct {
	Time  int64
	Value float64
}

type PromRuleManagersSpy

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

func NewPromRuleManagersSpy

func NewPromRuleManagersSpy() *PromRuleManagersSpy

func (*PromRuleManagersSpy) AlertingRules

func (p *PromRuleManagersSpy) AlertingRules() []*prom_rules.AlertingRule

func (*PromRuleManagersSpy) Alertmanagers

func (p *PromRuleManagersSpy) Alertmanagers() []*url.URL

func (*PromRuleManagersSpy) Create

func (*PromRuleManagersSpy) Delete

func (p *PromRuleManagersSpy) Delete(managerId string) error

func (*PromRuleManagersSpy) DeleteAll

func (p *PromRuleManagersSpy) DeleteAll() error

func (*PromRuleManagersSpy) DroppedAlertmanagers

func (p *PromRuleManagersSpy) DroppedAlertmanagers() []*url.URL

func (*PromRuleManagersSpy) ManagerIds

func (p *PromRuleManagersSpy) ManagerIds() []string

func (*PromRuleManagersSpy) Reload

func (p *PromRuleManagersSpy) Reload() error

func (*PromRuleManagersSpy) RuleGroups

func (p *PromRuleManagersSpy) RuleGroups() []*prom_rules.Group

type RuleManagerSpy

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

func NewRuleManagerSpy

func NewRuleManagerSpy() *RuleManagerSpy

func (*RuleManagerSpy) AddDroppedAlertmanagers

func (r *RuleManagerSpy) AddDroppedAlertmanagers(urls []*url.URL)

func (*RuleManagerSpy) AlertingRules

func (r *RuleManagerSpy) AlertingRules() []*prom_rules.AlertingRule

func (*RuleManagerSpy) Alertmanagers

func (r *RuleManagerSpy) Alertmanagers() []*url.URL

func (*RuleManagerSpy) CreateManager

func (r *RuleManagerSpy) CreateManager(managerId string, alertManagers *prom_config.AlertmanagerConfigs) (*rules.Manager, error)

func (*RuleManagerSpy) DeleteManager

func (r *RuleManagerSpy) DeleteManager(managerId string) error

func (*RuleManagerSpy) DroppedAlertmanagers

func (r *RuleManagerSpy) DroppedAlertmanagers() []*url.URL

func (*RuleManagerSpy) ManagerIds

func (r *RuleManagerSpy) ManagerIds() []string

func (*RuleManagerSpy) MethodsCalled

func (r *RuleManagerSpy) MethodsCalled() []string

func (*RuleManagerSpy) RuleGroupForManager

func (r *RuleManagerSpy) RuleGroupForManager(managerId string) *rulesclient.RuleGroup

func (*RuleManagerSpy) RuleGroups

func (r *RuleManagerSpy) RuleGroups() []*prom_rules.Group

func (*RuleManagerSpy) UpsertRuleGroup

func (r *RuleManagerSpy) UpsertRuleGroup(managerId string, ruleGroup *rulesclient.RuleGroup) error

type RulesApiError

type RulesApiError struct {
	Title  string `json:"title"`
	Status int    `json:"status"`
}

type RulesApiHttpError

type RulesApiHttpError struct {
	Status int
	Title  string
}

type RulesApiResponse

type RulesApiResponse struct {
	Errors []RulesApiError `json:"errors"`
}

type RulesApiSpy

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

func NewRulesApiSpy

func NewRulesApiSpy(tlsConfig *tls.Config) (*RulesApiSpy, error)

func (*RulesApiSpy) Addr

func (a *RulesApiSpy) Addr() string

func (*RulesApiSpy) LastRequestPath

func (a *RulesApiSpy) LastRequestPath() string

func (*RulesApiSpy) NextRequestError

func (a *RulesApiSpy) NextRequestError(err *RulesApiHttpError)

func (*RulesApiSpy) RequestsReceived

func (a *RulesApiSpy) RequestsReceived() int

func (*RulesApiSpy) Start

func (a *RulesApiSpy) Start() error

func (*RulesApiSpy) Stop

func (a *RulesApiSpy) Stop()

type ScrapeTargetSpy

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

func NewScrapeTargetSpy

func NewScrapeTargetSpy(tlsConfig *tls.Config) *ScrapeTargetSpy

func (*ScrapeTargetSpy) Addr

func (spy *ScrapeTargetSpy) Addr() string

func (*ScrapeTargetSpy) ScrapesReceived

func (spy *ScrapeTargetSpy) ScrapesReceived() int32

func (*ScrapeTargetSpy) Start

func (spy *ScrapeTargetSpy) Start()

func (*ScrapeTargetSpy) Stop

func (spy *ScrapeTargetSpy) Stop()

type Series

type Series struct {
	Labels map[string]string
	Points []Point
}

func ExplodeSeriesSet

func ExplodeSeriesSet(seriesSet storage.SeriesSet) []Series

type SpyAdapter

type SpyAdapter struct {
	CommittedPoints []*rpc.Point
}

func NewSpyAdapter

func NewSpyAdapter() *SpyAdapter

func (*SpyAdapter) WritePoints

func (s *SpyAdapter) WritePoints(points []*rpc.Point) error

type SpyAppender

type SpyAppender struct {
}

func (SpyAppender) Add

func (s SpyAppender) Add(l labels.Labels, t int64, v float64) (uint64, error)

func (SpyAppender) AddFast

func (s SpyAppender) AddFast(ref uint64, t int64, v float64) error

func (SpyAppender) Commit

func (s SpyAppender) Commit() error

func (SpyAppender) Rollback

func (s SpyAppender) Rollback() error

type SpyHistogramObserver

type SpyHistogramObserver struct {
	sync.Mutex
	Observations []float64
}

func (*SpyHistogramObserver) Observe

func (s *SpyHistogramObserver) Observe(value float64)

type SpyLookup

type SpyLookup struct {
	HashKeys []string
	Results  map[string][]int
	// contains filtered or unexported fields
}

func NewSpyLookup

func NewSpyLookup() *SpyLookup

func (*SpyLookup) GetHashKeys

func (s *SpyLookup) GetHashKeys() []string

func (*SpyLookup) Lookup

func (s *SpyLookup) Lookup(hashKey string) []int

type SpyMetricRegistrar

type SpyMetricRegistrar struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSpyMetricRegistrar

func NewSpyMetricRegistrar() *SpyMetricRegistrar

func (*SpyMetricRegistrar) Add

func (r *SpyMetricRegistrar) Add(name string, delta float64, labels ...string)

func (*SpyMetricRegistrar) Fetch

func (r *SpyMetricRegistrar) Fetch(name string) func() float64

func (*SpyMetricRegistrar) FetchHistogram

func (r *SpyMetricRegistrar) FetchHistogram(name string) func() []float64

func (*SpyMetricRegistrar) FetchOption

func (r *SpyMetricRegistrar) FetchOption(name string) func() *float64

func (*SpyMetricRegistrar) Gatherer

func (r *SpyMetricRegistrar) Gatherer() prometheus.Gatherer

func (*SpyMetricRegistrar) Histogram

func (r *SpyMetricRegistrar) Histogram(name string, labels ...string) prometheus.Observer

func (*SpyMetricRegistrar) Inc

func (r *SpyMetricRegistrar) Inc(name string, labels ...string)

func (*SpyMetricRegistrar) Registerer

func (r *SpyMetricRegistrar) Registerer() prometheus.Registerer

func (*SpyMetricRegistrar) Set

func (r *SpyMetricRegistrar) Set(name string, value float64, labels ...string)

type SpyMetricStore

type SpyMetricStore struct {
	ReloadRequestsCount atomic.Int32

	QueryError error
	// contains filtered or unexported fields
}

func NewSpyMetricStore

func NewSpyMetricStore(tlsConfig *tls.Config) *SpyMetricStore

func (*SpyMetricStore) Addr

func (s *SpyMetricStore) Addr() string

func (*SpyMetricStore) GetInternodePoints

func (s *SpyMetricStore) GetInternodePoints() []*rpc.Point

func (*SpyMetricStore) GetLocalOnlyValues

func (s *SpyMetricStore) GetLocalOnlyValues() []bool

func (*SpyMetricStore) GetPoints

func (s *SpyMetricStore) GetPoints() []*rpc.Point

func (*SpyMetricStore) Resume

func (s *SpyMetricStore) Resume()

func (*SpyMetricStore) SetValue

func (s *SpyMetricStore) SetValue(value float64)

func (*SpyMetricStore) Start

func (*SpyMetricStore) Stop

func (s *SpyMetricStore) Stop()

type SpyMetricStoreAddrs

type SpyMetricStoreAddrs struct {
	EgressAddr    string
	IngressAddr   string
	InternodeAddr string
}

type SpyQueue

type SpyQueue struct {
	PurgeCalls atomic.Int64
}

func NewSpyQueue

func NewSpyQueue(dir string) *SpyQueue

func (*SpyQueue) Advance

func (spy *SpyQueue) Advance() error

func (*SpyQueue) Append

func (spy *SpyQueue) Append(_ []byte) error

func (*SpyQueue) Close

func (spy *SpyQueue) Close() error

func (*SpyQueue) Current

func (spy *SpyQueue) Current() ([]byte, error)

func (*SpyQueue) DiskUsage

func (spy *SpyQueue) DiskUsage() int64

func (*SpyQueue) Open

func (spy *SpyQueue) Open() error

func (*SpyQueue) PurgeOlderThan

func (spy *SpyQueue) PurgeOlderThan(_ time.Time) error

func (*SpyQueue) SetMaxSegmentSize

func (spy *SpyQueue) SetMaxSegmentSize(size int64) error

type SpyStorage

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

func NewSpyStorage

func NewSpyStorage(querier storage.Querier) *SpyStorage

func (*SpyStorage) Appender

func (s *SpyStorage) Appender() storage.Appender

func (*SpyStorage) Close

func (s *SpyStorage) Close() error

func (*SpyStorage) Querier

func (s *SpyStorage) Querier(ctx context.Context, mint int64, maxt int64) (storage.Querier, error)

func (*SpyStorage) StartTime

func (s *SpyStorage) StartTime() (int64, error)

type SpyTCPClient

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

func NewSpyTCPClient

func NewSpyTCPClient() *SpyTCPClient

func (*SpyTCPClient) GetPoints

func (s *SpyTCPClient) GetPoints() []*rpc.Point

func (*SpyTCPClient) SetErr

func (s *SpyTCPClient) SetErr(err error)

func (*SpyTCPClient) Write

func (s *SpyTCPClient) Write(data []byte) (int, error)

type SpyTCPListener

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

func NewSpyTCPListener

func NewSpyTCPListener(tlsConfig *tls.Config) *SpyTCPListener

func (*SpyTCPListener) Address

func (s *SpyTCPListener) Address() string

func (*SpyTCPListener) GetPoints

func (s *SpyTCPListener) GetPoints() []*rpc.Point

func (*SpyTCPListener) Resume

func (s *SpyTCPListener) Resume() error

func (*SpyTCPListener) Start

func (s *SpyTCPListener) Start() error

func (*SpyTCPListener) Stop

func (s *SpyTCPListener) Stop()

type SpyUAA

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

TODO rename file

func NewSpyUAA

func NewSpyUAA(tlsConfig *tls.Config) *SpyUAA

func (*SpyUAA) Port

func (spy *SpyUAA) Port() string

func (*SpyUAA) Start

func (s *SpyUAA) Start() error

func (*SpyUAA) Stop

func (s *SpyUAA) Stop()

func (*SpyUAA) Url

func (s *SpyUAA) Url() string

type TempStorage

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

func NewTempStorage

func NewTempStorage(name string) TempStorage

func (TempStorage) Cleanup

func (s TempStorage) Cleanup()

func (TempStorage) CreateFile

func (s TempStorage) CreateFile(name string, content []byte) string

func (TempStorage) Directories

func (s TempStorage) Directories() []string

func (TempStorage) Directory

func (s TempStorage) Directory(p string) []string

func (TempStorage) FileNames

func (s TempStorage) FileNames() []string

func (TempStorage) Path

func (s TempStorage) Path() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to