Documentation ¶
Index ¶
- func MustCloseTestServer(ctrl server.Controller, srv *httptest.Server)
- func MustCreateTestServer() (server.Controller, *httptest.Server)
- func MustCreateUser(t testkit.TestingT, modifier func(u *auth.User)) (*auth.User, string)
- func MustCreateUserAPIKey(t testkit.TestingT, userUUID string, modifier func(k *auth.APIKey)) (*auth.APIKey, string)
- func MustCreateUserAuthJWTs(userUUID string) (string, string)
- func MustCreateUserFlag(t testkit.TestingT, userUUID string, name string) *flags.Flag
- func MustHashPassword(password string) string
- func RequireCreateDatabaseConn(t testkit.TestingT, dbPool *pgxpool.Pool, ctx context.Context) *pgxpool.Conn
- func RequireCreateDatabasePool(t testkit.TestingT) *pgxpool.Pool
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 ¶
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 ¶
MustCreateUserAuthJWTs creates and returns access and refresh JWTs for User and panics on error.
func MustCreateUserFlag ¶
MustCreateUserFlag creates and returns a new Flag for User and panics on error.
func MustHashPassword ¶
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.
Types ¶
This section is empty.