testdb

package
v0.6.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultUserPassword = "password"

Variables

This section is empty.

Functions

func PurgeDB

func PurgeDB(db convoyMongo.Client)

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

SeedAPIKey creates random api key for integration tests.

func SeedApplication

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

SeedApplication is create random application for integration tests.

func SeedConfiguration

func SeedConfiguration(db convoyMongo.Client) (*datastore.Configuration, error)

func SeedDefaultGroup

func SeedDefaultGroup(db convoyMongo.Client, orgID string) (*datastore.Group, error)

seed default group

func SeedDefaultOrganisation

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

seed default organisation

func SeedDefaultUser

func SeedDefaultUser(db convoyMongo.Client) (*datastore.User, error)

seed default user

func SeedEndpoint

func SeedEndpoint(db convoyMongo.Client, app *datastore.Application, groupID string) (*datastore.Endpoint, error)

func SeedEvent

func SeedEvent(db convoyMongo.Client, 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 convoyMongo.Client, 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 convoyMongo.Client, uid, name, orgID string, groupType datastore.GroupType, cfg *datastore.GroupConfig) (*datastore.Group, error)

seed default group

func SeedMultipleApplications

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

func SeedMultipleEndpoints

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

func SeedMultipleOrganisations

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

SeedMultipleOrganisations is creates random Organisations for integration tests.

func SeedOrganisation

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

SeedOrganisation is create random Organisation for integration tests.

func SeedOrganisationInvite

func SeedOrganisationInvite(db convoyMongo.Client, 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 convoyMongo.Client, org *datastore.Organisation, user *datastore.User, role *auth.Role) (*datastore.OrganisationMember, error)

seed organisation member

func SeedSource

func SeedSource(db convoyMongo.Client, g *datastore.Group, uid, maskID, ds string, v *datastore.VerifierConfig) (*datastore.Source, error)

func SeedUser

func SeedUser(db convoyMongo.Client, 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