Help us shape the future of Go! Take the 2026 Go Developer Survey

setup

package
v1.0.1351 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DUTY_DB_CREATE      = "DUTY_DB_CREATE"
	DUTY_DB_DISABLE_RLS = "DUTY_DB_DISABLE_RLS"
)
View Source
const (
	DUTY_DB_DATA_DIR = "DUTY_DB_DATA_DIR"
	DUTY_DB_URL      = "DUTY_DB_URL"
	TEST_DB_PORT     = "TEST_DB_PORT"
)

Env vars for embedded db

Variables

View Source
var DefaultContext context.Context
View Source
var PgUrl string
View Source
var WithExistingDatabase = "with_existing_database"
View Source
var WithoutDummyData = "without_dummy_data"
View Source
var WithoutRLS = "rls_disabled"

Functions

func AfterSuiteFn

func AfterSuiteFn()

func BeforeSuiteFn

func BeforeSuiteFn(args ...interface{}) context.Context

func CreateUserWithRole added in v1.0.1059

func CreateUserWithRole(ctx context.Context, name, email string, roles ...string) *models.Person

CreateUserWithRole creates a user and assigns the specified roles

func DumpEventQueue added in v1.0.265

func DumpEventQueue(ctx context.Context)

func ExpectJobToPass added in v1.0.265

func ExpectJobToPass(j *job.Job)

func GetEmbeddedPGConfig added in v1.0.254

func GetEmbeddedPGConfig(database string, port int) (embeddedPG.Config, string)

func MustDB

func MustDB() *sql.DB

func NewDB added in v1.0.265

func NewDB(ctx context.Context, name string) (*context.Context, func(), error)

NewDB creates a new database from an existing context, and returns the new context and a function that be called to drop it

func RestartEmbeddedPG added in v1.0.785

func RestartEmbeddedPG() error

func RunEcho added in v1.0.265

func RunEcho(e *echo.Echo) (int, func())

func SetupDB added in v1.0.785

func SetupDB(dbName string, args ...interface{}) (context.Context, error)

func SetupNode added in v1.0.1247

func SetupNode(data []byte, opts SetupOpts) context.Context

func SetupTemplate added in v1.0.1247

func SetupTemplate(opts SetupOpts) []byte

func SynchronizedAfterSuiteAllNodes added in v1.0.1247

func SynchronizedAfterSuiteAllNodes()

func SynchronizedAfterSuiteNode1 added in v1.0.1247

func SynchronizedAfterSuiteNode1()

Types

type SetupOpts added in v1.0.1247

type SetupOpts struct {
	DummyData bool
}

Jump to

Keyboard shortcuts

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