crontest

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package crontest opens the cron store on pgmem, CSF's in-process substitute for PostgreSQL, with CSF's real schema applied: the store a spec grants when it needs cron state without a database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IReporter

type IReporter interface {
	Helper()
	Fatalf(format string, arguments ...any)
	Cleanup(cleanup func())
}

IReporter is the part of a spec runner the store is opened against: GinkgoT() and *testing.T both satisfy it.

type MemoryStore

type MemoryStore struct {
	*cron.Store
	// contains filtered or unexported fields
}

MemoryStore is the cron store over one pgmem database of its own. Close releases the database.

func OpenMemoryStore

func OpenMemoryStore(ctx context.Context) (*MemoryStore, error)

OpenMemoryStore applies CSF's schema to a new pgmem database and returns the cron store over it.

func OpenStore

func OpenStore(reporter IReporter) *MemoryStore

OpenStore opens a store for one spec and closes it when the spec ends; a store that cannot be opened fails the spec.

func (*MemoryStore) Close

func (store *MemoryStore) Close() error

Close releases the pgmem database.

func (*MemoryStore) Database

func (store *MemoryStore) Database() csfpg.IDB

Database is the csfpg capability the store runs on, for a spec that reads the rows the store wrote.

Jump to

Keyboard shortcuts

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