retentiontest

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package retentiontest holds checks that every retention.Store backend must pass, so the five stores are held to one definition of a purge scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PurgeScope

func PurgeScope(t *testing.T, s Store, run string)

PurgeScope checks that EventsOlderThan matches a purge query's scope exactly. An empty TenantID selects the app's untenanted events and nothing else, and an empty AppID selects events with no app. Neither is a wildcard: a policy saved at app level must not reach into its tenants' history.

s must start empty of events for the IDs used here. run is appended to every app and tenant ID, so backends shared between tests can pass a random value.

Types

type Store

type Store interface {
	retention.Store
	Append(ctx context.Context, event *audit.Event) error
	CreateStream(ctx context.Context, s *stream.Stream) error
}

Store is what PurgeScope needs from a backend: the retention methods under test, plus enough of the event and stream API to seed events.

Jump to

Keyboard shortcuts

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