testing

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

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 NewServerRequest

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

func NewTLSConfig

func NewTLSConfig(caPath, certPath, keyPath, cn string) (*tls.Config, error)

func ParseTimeWithDecimalMillis

func ParseTimeWithDecimalMillis(t string) time.Time

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

Types

type SpyAgent

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

func NewSpyAgent

func NewSpyAgent(tlsConfig *tls.Config) *SpyAgent

func (*SpyAgent) BatchSender

func (*SpyAgent) GetEnvelopes

func (s *SpyAgent) GetEnvelopes() []*loggregator_v2.Envelope

func (*SpyAgent) Send

func (*SpyAgent) Sender

func (*SpyAgent) Start

func (s *SpyAgent) Start() string

type SpyLogCache

type SpyLogCache struct {
	QueryError error

	ReadEnvelopes map[string]func() []*loggregator_v2.Envelope
	MetaResponses map[string]*rpc.MetaInfo
	// contains filtered or unexported fields
}

func NewSpyLogCache

func NewSpyLogCache(tlsConfig *tls.Config) *SpyLogCache

func (*SpyLogCache) GetEnvelopes

func (s *SpyLogCache) GetEnvelopes() []*loggregator_v2.Envelope

func (*SpyLogCache) GetLocalOnlyValues

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

func (*SpyLogCache) GetQueryRequests

func (s *SpyLogCache) GetQueryRequests() []*rpc.PromQL_InstantQueryRequest

func (*SpyLogCache) GetRangeQueryRequests

func (s *SpyLogCache) GetRangeQueryRequests() []*rpc.PromQL_RangeQueryRequest

func (*SpyLogCache) GetReadRequests

func (s *SpyLogCache) GetReadRequests() []*rpc.ReadRequest

func (*SpyLogCache) Meta

func (*SpyLogCache) RangeQuery

func (*SpyLogCache) Read

func (*SpyLogCache) Send

func (*SpyLogCache) SetValue

func (s *SpyLogCache) SetValue(value float64)

func (*SpyLogCache) Start

func (s *SpyLogCache) Start() string

type SpyMetrics

type SpyMetrics struct {
	Names  []string
	Deltas []uint64
	Gauges map[string][]float64
	Map    map[string]uint64

	sync.Mutex
}

func NewSpyMetrics

func NewSpyMetrics() *SpyMetrics

func (*SpyMetrics) Getter

func (s *SpyMetrics) Getter(key string) func() uint64

func (*SpyMetrics) NewCounter

func (s *SpyMetrics) NewCounter(name string) func(delta uint64)

func (*SpyMetrics) NewGauge

func (s *SpyMetrics) NewGauge(name string) func(value float64)

Jump to

Keyboard shortcuts

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