Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BuildExpectedLog(timestamp time.Time, ...) string
- func BuildRequest(method, url, remoteAddr, requestId, forwardedFor string) *http.Request
- func Cert(filename string) string
- func FormatTimeWithDecimalMillis(t time.Time) string
- func GetFreePort() int
- func MustAsset(name string) []byte
- func NewServerRequest(method, uri string, body io.Reader) (*http.Request, error)
- func NewTLSConfig(caPath, certPath, keyPath, cn string) (*tls.Config, error)
- func ParseTimeWithDecimalMillis(t string) time.Time
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type SpyAgent
- func (s *SpyAgent) BatchSender(_ loggregator_v2.Ingress_BatchSenderServer) error
- func (s *SpyAgent) GetEnvelopes() []*loggregator_v2.Envelope
- func (s *SpyAgent) Send(ctx context.Context, batch *loggregator_v2.EnvelopeBatch) (*loggregator_v2.SendResponse, error)
- func (s *SpyAgent) Sender(_ loggregator_v2.Ingress_SenderServer) error
- func (s *SpyAgent) Start() string
- type SpyLogCache
- func (s *SpyLogCache) GetEnvelopes() []*loggregator_v2.Envelope
- func (s *SpyLogCache) GetLocalOnlyValues() []bool
- func (s *SpyLogCache) GetQueryRequests() []*rpc.PromQL_InstantQueryRequest
- func (s *SpyLogCache) GetRangeQueryRequests() []*rpc.PromQL_RangeQueryRequest
- func (s *SpyLogCache) GetReadRequests() []*rpc.ReadRequest
- func (s *SpyLogCache) InstantQuery(ctx context.Context, r *rpc.PromQL_InstantQueryRequest) (*rpc.PromQL_InstantQueryResult, error)
- func (s *SpyLogCache) Meta(ctx context.Context, r *rpc.MetaRequest) (*rpc.MetaResponse, error)
- func (s *SpyLogCache) RangeQuery(ctx context.Context, r *rpc.PromQL_RangeQueryRequest) (*rpc.PromQL_RangeQueryResult, error)
- func (s *SpyLogCache) Read(ctx context.Context, r *rpc.ReadRequest) (*rpc.ReadResponse, error)
- func (s *SpyLogCache) Send(ctx context.Context, r *rpc.SendRequest) (*rpc.SendResponse, error)
- func (s *SpyLogCache) SetValue(value float64)
- func (s *SpyLogCache) Start() string
- type SpyMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
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 ¶
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 ¶
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 BuildExpectedLog ¶
func BuildRequest ¶
func GetFreePort ¶
func GetFreePort() int
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewServerRequest ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type SpyAgent ¶
type SpyAgent struct {
// contains filtered or unexported fields
}
func NewSpyAgent ¶
func (*SpyAgent) BatchSender ¶
func (s *SpyAgent) BatchSender(_ loggregator_v2.Ingress_BatchSenderServer) error
func (*SpyAgent) GetEnvelopes ¶
func (s *SpyAgent) GetEnvelopes() []*loggregator_v2.Envelope
func (*SpyAgent) Send ¶
func (s *SpyAgent) Send(ctx context.Context, batch *loggregator_v2.EnvelopeBatch) (*loggregator_v2.SendResponse, error)
func (*SpyAgent) Sender ¶
func (s *SpyAgent) Sender(_ loggregator_v2.Ingress_SenderServer) error
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) InstantQuery ¶
func (s *SpyLogCache) InstantQuery(ctx context.Context, r *rpc.PromQL_InstantQueryRequest) (*rpc.PromQL_InstantQueryResult, error)
func (*SpyLogCache) Meta ¶
func (s *SpyLogCache) Meta(ctx context.Context, r *rpc.MetaRequest) (*rpc.MetaResponse, error)
func (*SpyLogCache) RangeQuery ¶
func (s *SpyLogCache) RangeQuery(ctx context.Context, r *rpc.PromQL_RangeQueryRequest) (*rpc.PromQL_RangeQueryResult, error)
func (*SpyLogCache) Read ¶
func (s *SpyLogCache) Read(ctx context.Context, r *rpc.ReadRequest) (*rpc.ReadResponse, error)
func (*SpyLogCache) Send ¶
func (s *SpyLogCache) Send(ctx context.Context, r *rpc.SendRequest) (*rpc.SendResponse, error)
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)