testutils

package
v1.0.0-beta.225 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStreamingConnector

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

func NewMockStreamingConnector

func NewMockStreamingConnector(t testing.TB) *MockStreamingConnector

func (*MockStreamingConnector) AddRow

func (m *MockStreamingConnector) AddRow(meterSlug string, row meter.MeterQueryRow)

func (*MockStreamingConnector) AddSimpleEvent

func (m *MockStreamingConnector) AddSimpleEvent(meterSlug string, value float64, at time.Time)

func (*MockStreamingConnector) BatchInsert

func (m *MockStreamingConnector) BatchInsert(ctx context.Context, events []streaming.RawEvent) error

func (*MockStreamingConnector) CountEvents

func (*MockStreamingConnector) CreateNamespace

func (c *MockStreamingConnector) CreateNamespace(ctx context.Context, namespace string) error

func (*MockStreamingConnector) DeleteNamespace

func (c *MockStreamingConnector) DeleteNamespace(ctx context.Context, namespace string) error

func (*MockStreamingConnector) ListEvents

func (m *MockStreamingConnector) ListEvents(ctx context.Context, namespace string, params streaming.ListEventsParams) ([]streaming.RawEvent, error)

func (*MockStreamingConnector) ListEventsV2

func (*MockStreamingConnector) ListGroupByValues

func (m *MockStreamingConnector) ListGroupByValues(ctx context.Context, params streaming.ListGroupByValuesParams) ([]string, error)

func (*MockStreamingConnector) ListSubjects

func (*MockStreamingConnector) QueryMeter

func (m *MockStreamingConnector) QueryMeter(ctx context.Context, namespace string, mm meter.Meter, params streaming.QueryParams) ([]meter.MeterQueryRow, error)

Returns the result query set for the given params. If the query set is not found, it will try to approximate the result by aggregating the simple events

func (*MockStreamingConnector) Reset

func (m *MockStreamingConnector) Reset()

func (*MockStreamingConnector) SetSimpleEvents

func (m *MockStreamingConnector) SetSimpleEvents(meterSlug string, fn func(events []SimpleEvent) []SimpleEvent)

func (*MockStreamingConnector) ValidateJSONPath

func (m *MockStreamingConnector) ValidateJSONPath(ctx context.Context, jsonPath string) (bool, error)

type SimpleEvent

type SimpleEvent struct {
	MeterSlug string
	Value     float64
	Time      time.Time
}

Jump to

Keyboard shortcuts

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