testdb

package
v0.6.0-rc Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PurgeDB

func PurgeDB(db datastore.DatabaseClient)

PurgeDB is run after every test run and it's used to truncate the DB to have a clean slate in the next run.

func SeedAPIKey

func SeedAPIKey(db datastore.DatabaseClient, g *datastore.Group, uid, name, keyType string) (*datastore.APIKey, error)

SeedAPIKey creates random api key for integration tests.

func SeedApplication

func SeedApplication(db datastore.DatabaseClient, g *datastore.Group, uid, title string, disabled bool) (*datastore.Application, error)

SeedApplication is create random application for integration tests.

func SeedDefaultGroup

func SeedDefaultGroup(db datastore.DatabaseClient) (*datastore.Group, error)

seed default group

func SeedEndpoint

func SeedEndpoint(db datastore.DatabaseClient, app *datastore.Application, groupID string, events []string) (*datastore.Endpoint, error)

func SeedEvent

func SeedEvent(db datastore.DatabaseClient, app *datastore.Application, groupID string, uid, eventType string, data []byte) (*datastore.Event, error)

SeedEvent creates a random event for integration tests.

func SeedEventDelivery

func SeedEventDelivery(db datastore.DatabaseClient, app *datastore.Application, event *datastore.Event, endpoint *datastore.Endpoint, groupID string, uid string, status datastore.EventDeliveryStatus) (*datastore.EventDelivery, error)

SeedEventDelivery creates a random event delivery for integration tests.

func SeedGroup

func SeedGroup(db datastore.DatabaseClient, uid, name string, cfg *datastore.GroupConfig) (*datastore.Group, error)

seed default group

func SeedMultipleApplications

func SeedMultipleApplications(db datastore.DatabaseClient, g *datastore.Group, count int) error

func SeedMultipleEndpoints

func SeedMultipleEndpoints(db datastore.DatabaseClient, app *datastore.Application, groupID string, events []string, count int) ([]datastore.Endpoint, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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