testing

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 26 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 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 StartGoProcess

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

func WaitForHealthCheck

func WaitForHealthCheck(healthPort string)

Types

type Point

type Point struct {
	Time  int64
	Value float64
}

type Series

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

func ExplodeSeriesSet

func ExplodeSeriesSet(seriesSet storage.SeriesSet) []Series

type SpyAdapter added in v1.2.1

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

func NewSpyAdapter added in v1.2.1

func NewSpyAdapter() *SpyAdapter

func (*SpyAdapter) WritePoints added in v1.2.1

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

type SpyMetricRegistrar added in v1.2.1

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

func NewSpyMetricRegistrar added in v1.2.1

func NewSpyMetricRegistrar() *SpyMetricRegistrar

func (*SpyMetricRegistrar) Add added in v1.2.1

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

func (*SpyMetricRegistrar) Fetch added in v1.2.1

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

func (*SpyMetricRegistrar) Gatherer added in v1.2.1

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

func (*SpyMetricRegistrar) Inc added in v1.2.1

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

func (*SpyMetricRegistrar) Registerer added in v1.2.1

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

func (*SpyMetricRegistrar) Set added in v1.2.1

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

type SpyMetricStore

type SpyMetricStore struct {
	QueryError error
	// contains filtered or unexported fields
}

func NewSpyMetricStore

func NewSpyMetricStore(tlsConfig *tls.Config) *SpyMetricStore

func (*SpyMetricStore) GetPoints

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

func (*SpyMetricStore) SetValue

func (s *SpyMetricStore) SetValue(value float64)

func (*SpyMetricStore) Start

func (*SpyMetricStore) Stop added in v1.2.1

func (s *SpyMetricStore) Stop()

type SpyMetricStoreAddrs added in v1.2.1

type SpyMetricStoreAddrs struct {
	EgressAddr  string
	IngressAddr string
}

type SpyStorage added in v1.2.1

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

func NewSpyStorage added in v1.2.1

func NewSpyStorage(querier storage.Querier) *SpyStorage

func (*SpyStorage) Appender added in v1.2.1

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

func (*SpyStorage) Close added in v1.2.1

func (s *SpyStorage) Close() error

func (*SpyStorage) Querier added in v1.2.1

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

func (*SpyStorage) StartTime added in v1.2.1

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

type SpyUAA added in v1.2.1

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

func NewSpyUAA added in v1.2.1

func NewSpyUAA(tlsConfig *tls.Config) *SpyUAA

func (*SpyUAA) Start added in v1.2.1

func (s *SpyUAA) Start() error

func (*SpyUAA) Url added in v1.2.1

func (s *SpyUAA) Url() string

Jump to

Keyboard shortcuts

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