serverstore

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package serverstore implements storing logic for fakeintake server Stores raw payloads and try parsing known payloads dumping them to json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJSONPayloads added in v0.53.0

func GetJSONPayloads(store Store, route string) ([]api.ParsedPayload, error)

GetJSONPayloads returns the parsed payloads for a given route

func IsRouteHandled

func IsRouteHandled(route string) bool

IsRouteHandled checks if a route is handled by the Datadog parsed store

Types

type Store

type Store interface {
	// AppendPayload adds a payload to the store and tries parsing and adding a dumped json to the parsed store
	AppendPayload(route string, data []byte, encoding string, contentType string, collectTime time.Time) error
	// CleanUpPayloadsOlderThan removes payloads older than the given time
	CleanUpPayloadsOlderThan(time.Time)
	// GetRawPayloads returns all raw payloads for a given route
	GetRawPayloads(route string) []api.Payload
	// GetRouteStats returns the number of payloads for each route
	GetRouteStats() map[string]int
	// Flush flushes the store
	Flush()
	// GetInternalMetrics returns the prometheus metrics for the store
	GetInternalMetrics() []prometheus.Collector
	// Close closes the store
	Close()
}

Store is the interface for a store that can store payloads and try parsing them

func NewStore

func NewStore(driver string) Store

NewStore returns a new store

Jump to

Keyboard shortcuts

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