Documentation ¶
Index ¶
- Constants
- Variables
- func DropAllDatabases() error
- func Time(s string) time.Time
- type EventInfo
- type Row
- type Rows
- type TempDB
- type TestScenario
- func (t *TestScenario) AddComponent(planName, validFrom, componentName, formula, currency, vat string)
- func (t *TestScenario) AddComputePlan()
- func (t *TestScenario) AppLifeCycle(orgName string, spaceName string, appName string, eventsInfo ...EventInfo)
- func (t *TestScenario) DeltaTime(ds string) time.Time
- func (t *TestScenario) DeltaTimeJSON(ds string) string
- func (t *TestScenario) DeltaTimeRFC3339(ds string) string
- func (t *TestScenario) FlushAppEvents(db *TempDB) error
- func (t *TestScenario) FlushEntities(db *TempDB, cfg eventstore.Config) error
- func (t *TestScenario) GetAppEventGUIDs(orgName, spaceName, appName string) []string
- func (t *TestScenario) GetAppGUID(orgName, spaceName, appName string) string
- func (t *TestScenario) GetOrgGUID(orgName string) string
- func (t *TestScenario) GetPlan(planName, validFrom string) *eventio.PricingPlan
- func (t *TestScenario) GetPlanGUID(planName, validFrom string) string
- func (t *TestScenario) GetSpaceGUID(orgName, spaceName string) string
- func (t *TestScenario) Open(cfg eventstore.Config) (*TempDB, error)
- func (t *TestScenario) OpenInto(db *TempDB, cfg eventstore.Config) error
- func (t *TestScenario) OpenWithContext(cfg eventstore.Config, ctx context.Context) (*TempDB, error)
Constants ¶
View Source
const ISO8601 = "2006-01-02T15:04:05-07:00"
Variables ¶
View Source
var BasicConfig = eventstore.Config{ VATRates: []eventio.VATRate{ { Code: "Standard", Rate: 0.2, ValidFrom: "epoch", }, }, CurrencyRates: []eventio.CurrencyRate{ { Code: "GBP", Rate: 1, ValidFrom: "epoch", }, }, PricingPlans: []eventio.PricingPlan{}, }
Functions ¶
func DropAllDatabases ¶ added in v0.132.0
func DropAllDatabases() error
Types ¶
type TempDB ¶
type TempDB struct { MasterConnectionString string TempConnectionString string Schema eventio.EventStore Conn *sql.DB // contains filtered or unexported fields }
func OpenWithContext ¶ added in v0.132.0
Opens creates a new database named test_<uuid> and runs Init() with the given config
func (*TempDB) Close ¶
Close closes the database connection. This needs to gracefully handle the database, and the connection being 'nil' - some specs deliberately cause this state
func (*TempDB) Get ¶
Perform a query that returns a single row single column and return whatever it is This is useful for testing
type TestScenario ¶ added in v0.43.0
type TestScenario struct {
// contains filtered or unexported fields
}
func NewTestScenario ¶ added in v0.43.0
func NewTestScenario(baseTimeStr string) *TestScenario
func (*TestScenario) AddComponent ¶ added in v0.43.0
func (t *TestScenario) AddComponent(planName, validFrom, componentName, formula, currency, vat string)
func (*TestScenario) AddComputePlan ¶ added in v0.43.0
func (t *TestScenario) AddComputePlan()
func (*TestScenario) AppLifeCycle ¶ added in v0.43.0
func (t *TestScenario) AppLifeCycle( orgName string, spaceName string, appName string, eventsInfo ...EventInfo, )
func (*TestScenario) DeltaTime ¶ added in v0.43.0
func (t *TestScenario) DeltaTime(ds string) time.Time
func (*TestScenario) DeltaTimeJSON ¶ added in v0.43.0
func (t *TestScenario) DeltaTimeJSON(ds string) string
func (*TestScenario) DeltaTimeRFC3339 ¶ added in v0.43.0
func (t *TestScenario) DeltaTimeRFC3339(ds string) string
func (*TestScenario) FlushAppEvents ¶ added in v0.43.0
func (t *TestScenario) FlushAppEvents(db *TempDB) error
func (*TestScenario) FlushEntities ¶ added in v0.53.0
func (t *TestScenario) FlushEntities(db *TempDB, cfg eventstore.Config) error
func (*TestScenario) GetAppEventGUIDs ¶ added in v0.43.0
func (t *TestScenario) GetAppEventGUIDs(orgName, spaceName, appName string) []string
func (*TestScenario) GetAppGUID ¶ added in v0.43.0
func (t *TestScenario) GetAppGUID(orgName, spaceName, appName string) string
func (*TestScenario) GetOrgGUID ¶ added in v0.43.0
func (t *TestScenario) GetOrgGUID(orgName string) string
func (*TestScenario) GetPlan ¶ added in v0.43.0
func (t *TestScenario) GetPlan(planName, validFrom string) *eventio.PricingPlan
func (*TestScenario) GetPlanGUID ¶ added in v0.43.0
func (t *TestScenario) GetPlanGUID(planName, validFrom string) string
func (*TestScenario) GetSpaceGUID ¶ added in v0.43.0
func (t *TestScenario) GetSpaceGUID(orgName, spaceName string) string
func (*TestScenario) Open ¶ added in v0.43.0
func (t *TestScenario) Open(cfg eventstore.Config) (*TempDB, error)
func (*TestScenario) OpenInto ¶ added in v0.132.0
func (t *TestScenario) OpenInto(db *TempDB, cfg eventstore.Config) error
func (*TestScenario) OpenWithContext ¶ added in v0.132.0
func (t *TestScenario) OpenWithContext(cfg eventstore.Config, ctx context.Context) (*TempDB, error)
Click to show internal directories.
Click to hide internal directories.