Documentation ¶
Overview ¶
Package server implements a dummy http Datadog intake, meant to be used with integration and e2e tests. It runs an catch-all http server that stores submitted payloads into a dictionary of api.Payloads, indexed by the route It implements 3 testing endpoints:
- /fakeintake/payloads/<payload_route> returns any received payloads on the specified route as [api.Payload]s
- /fakeintake/health returns current fakeintake server health
- /fakeintake/routestats returns stats for collected payloads, by route
- /fakeintake/flushPayloads returns all stored payloads and clear them up
Package server implements a dummy http Datadog intake, meant to be used with integration and e2e tests. It runs an catch-all http server that stores submitted payloads into a dictionary of api.Payloads, indexed by the route It implements 3 testing endpoints:
- /fakeintake/payloads/<payload_route> returns any received payloads on the specified route as [api.Payload]s
- /fakeintake/health returns current fakeintake server health
- /fakeintake/routestats returns stats for collected payloads, by route
- /fakeintake/flushPayloads returns all stored payloads and clear them up
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithStoreDriver ¶ added in v0.54.0
WithStoreDriver changes the store driver used by the server
Types ¶
type Option ¶ added in v0.54.0
type Option func(*Server)
Option is a function that modifies a Server
func WithAddress ¶ added in v0.53.0
WithAddress changes the server host:port. If host is empty, it will bind to 0.0.0.0 If the port is empty or 0, a port number is automatically chosen
func WithDDDevForward ¶ added in v0.57.0
func WithDDDevForward() Option
WithDDDevForward enable forwarding payload to dddev
func WithPort ¶
WithPort changes the server port. If the port is 0, a port number is automatically chosen
func WithReadyChannel ¶
WithReadyChannel assign a boolean channel to get notified when the server is ready
func WithRetention ¶
WithRetention changes the retention time of payloads in the store
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a struct implementing a fakeintake server
func InitialiseForTests ¶ added in v0.51.0
InitialiseForTests starts a server with a mock clock and waits for it to be ready. It returns the mock clock and the server. Use defer server.Stop() to stop the server after calling this function.
func NewServer ¶
NewServer creates a new fakeintake server and starts it on localhost:port options accept WithPort and WithReadyChan. Call Server.Start() to start the server in a separate go-routine If the port is 0, a port number is automatically chosen
Directories ¶
Path | Synopsis |
---|---|
Package serverstore implements storing logic for fakeintake server Stores raw payloads and try parsing known payloads dumping them to json
|
Package serverstore implements storing logic for fakeintake server Stores raw payloads and try parsing known payloads dumping them to json |