testdb

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultUserPassword = "password"

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, role auth.Role, uid, name, keyType string) (*datastore.APIKey, string, 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, orgID string) (*datastore.Group, error)

seed default group

func SeedDefaultOrganisation

func SeedDefaultOrganisation(db datastore.DatabaseClient, user *datastore.User) (*datastore.Organisation, error)

seed default organisation

func SeedDefaultUser

func SeedDefaultUser(db datastore.DatabaseClient) (*datastore.User, error)

seed default user

func SeedEndpoint

func SeedEndpoint(db datastore.DatabaseClient, app *datastore.Application, groupID 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, subcription *datastore.Subscription) (*datastore.EventDelivery, error)

SeedEventDelivery creates a random event delivery for integration tests.

func SeedGroup

func SeedGroup(db datastore.DatabaseClient, uid, name, orgID string, groupType datastore.GroupType, 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)

func SeedMultipleOrganisations

func SeedMultipleOrganisations(db datastore.DatabaseClient, ownerID string, num int) ([]*datastore.Organisation, error)

SeedMultipleOrganisations is creates random Organisations for integration tests.

func SeedOrganisation

func SeedOrganisation(db datastore.DatabaseClient, uid, ownerID, name string) (*datastore.Organisation, error)

SeedOrganisation is create random Organisation for integration tests.

func SeedOrganisationInvite

func SeedOrganisationInvite(db datastore.DatabaseClient, org *datastore.Organisation, email string, role *auth.Role, expiry primitive.DateTime, status datastore.InviteStatus) (*datastore.OrganisationInvite, error)

seed organisation invite

func SeedOrganisationMember

func SeedOrganisationMember(db datastore.DatabaseClient, org *datastore.Organisation, user *datastore.User, role *auth.Role) (*datastore.OrganisationMember, error)

seed organisation member

func SeedUser

func SeedUser(db datastore.DatabaseClient, email, password string) (*datastore.User, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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