testkitinternal

package
v0.0.0-...-d6d061b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCloseTestServer

func MustCloseTestServer(ctrl server.Controller, srv *httptest.Server)

MustCloseTestServer closes a Controller and an HTTP server.

func MustCreateTestServer

func MustCreateTestServer() (server.Controller, *httptest.Server)

MustCreateTestServer creates a new Controller, sets up a new test HTTP server and panics on error.

func MustCreateUser

func MustCreateUser(t testkit.TestingT, modifier func(u *auth.User)) (*auth.User, string)

MustCreateUser creates and returns a new user and panics on error.

func MustCreateUserAPIKey

func MustCreateUserAPIKey(t testkit.TestingT, userUUID string, modifier func(k *auth.APIKey)) (*auth.APIKey, string)

MustCreateUserAPIKey creates and returns a new API key for User and panics on error.

func MustCreateUserAuthJWTs

func MustCreateUserAuthJWTs(userUUID string) (string, string)

MustCreateUserAuthJWTs creates and returns access and refresh JWTs for User and panics on error.

func MustCreateUserFlag

func MustCreateUserFlag(t testkit.TestingT, userUUID string, name string) *flags.Flag

MustCreateUserFlag creates and returns a new Flag for User and panics on error.

func MustHashPassword

func MustHashPassword(password string) string

MustHashPassword hashes a given password and panics on error

func RequireCreateDatabaseConn

func RequireCreateDatabaseConn(t testkit.TestingT, dbPool *pgxpool.Pool, ctx context.Context) *pgxpool.Conn

RequireCreateDatabaseConn creates and returns a new database connection from a given connection pool. It also asserts no error is returned and declares clean up function to close the connection.

func RequireCreateDatabasePool

func RequireCreateDatabasePool(t testkit.TestingT) *pgxpool.Pool

RequireCreateDatabasePool creates and returns a new database connection pool. It also asserts no error is returned and declares clean up function to close the pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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