testutil

package
v0.3.7-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAllTables

func CleanAllTables(db *gorm.DB) error

CleanAllTables Drops all tables

func CreateBlackTeam

func CreateBlackTeam(db *gorm.DB) (err error)

CreateBlackTeam Ensures that black team exists

func CreatePolicy

func CreatePolicy(db *gorm.DB) (*policy.Policy, error)

CreatePolicy Ensure policy.Policy exists

func DataPreload

func DataPreload(db *gorm.DB)

func DropDB

func DropDB(db *gorm.DB, c config.StaticConfig)

func SetupCockroachDB

func SetupCockroachDB(c storage.Config) *gorm.DB

SetupCockroachDB

func SetupDB added in v0.3.6

func SetupDB(c storage.Config) *gorm.DB

func SetupSqliteDB added in v0.3.6

func SetupSqliteDB(c storage.Config) (db *gorm.DB)

SetupSqliteDB creates a new database instance using

func TruncateAllTables

func TruncateAllTables(db *gorm.DB)

TruncateAllTables truncates all tables (A little faster than dropping)

func TruncateTable

func TruncateTable(ctx context.Context, v interface{}, db *gorm.DB) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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