testdb

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: CC-BY-4.0, MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)

Functions

This section is empty.

Types

type AppClientBuilder

type AppClientBuilder struct {
	// contains filtered or unexported fields
}

AppClientBuilder has helper methods to create applications and clients.

func (*AppClientBuilder) App

func (ab *AppClientBuilder) App(id uint) *MessageBuilder

App creates an application and returns a message builder.

func (*AppClientBuilder) AppWithToken

func (ab *AppClientBuilder) AppWithToken(id uint, token string) *MessageBuilder

AppWithToken creates an application with a token and returns a message builder.

func (*AppClientBuilder) AppWithTokenAndDefaultPriority

func (ab *AppClientBuilder) AppWithTokenAndDefaultPriority(id uint, token string, defaultPriority int) *MessageBuilder

AppWithTokenAndDefaultPriority creates an application with a token and defaultPriority and returns a message builder.

func (*AppClientBuilder) AppWithTokenAndName

func (ab *AppClientBuilder) AppWithTokenAndName(id uint, token, name string) *MessageBuilder

AppWithTokenAndName creates an application with a token and name and returns a message builder.

func (*AppClientBuilder) Client

func (ab *AppClientBuilder) Client(id uint) *AppClientBuilder

Client creates a client and returns itself.

func (*AppClientBuilder) ClientWithToken

func (ab *AppClientBuilder) ClientWithToken(id uint, token string) *AppClientBuilder

ClientWithToken creates a client with a token and returns itself.

func (*AppClientBuilder) ElevatedClientWithToken added in v3.1.1

func (ab *AppClientBuilder) ElevatedClientWithToken(id uint, token string) *AppClientBuilder

ElevatedClientWithToken creates an elevated client.

func (*AppClientBuilder) InternalApp

func (ab *AppClientBuilder) InternalApp(id uint) *MessageBuilder

InternalApp creates an internal application and returns a message builder.

func (*AppClientBuilder) InternalAppWithToken

func (ab *AppClientBuilder) InternalAppWithToken(id uint, token string) *MessageBuilder

InternalAppWithToken creates an internal application with a token and returns a message builder.

func (*AppClientBuilder) InternalAppWithTokenAndName

func (ab *AppClientBuilder) InternalAppWithTokenAndName(id uint, token, name string) *MessageBuilder

InternalAppWithTokenAndName creates an internal application with a token and name and returns a message builder.

func (*AppClientBuilder) NewAppWithToken

func (ab *AppClientBuilder) NewAppWithToken(id uint, token string) *model.Application

NewAppWithToken creates an application with a token and returns the app.

func (*AppClientBuilder) NewAppWithTokenAndDefaultPriority

func (ab *AppClientBuilder) NewAppWithTokenAndDefaultPriority(id uint, token string, defaultPriority int) *model.Application

NewAppWithTokenAndDefaultPriority creates an application with a token and defaultPriority and returns the app.

func (*AppClientBuilder) NewAppWithTokenAndName

func (ab *AppClientBuilder) NewAppWithTokenAndName(id uint, token, name string) *model.Application

NewAppWithTokenAndName creates an application with a token and name and returns the app.

func (*AppClientBuilder) NewClientWithToken

func (ab *AppClientBuilder) NewClientWithToken(id uint, token string) *model.Client

NewClientWithToken creates a client with a token and returns the client.

func (*AppClientBuilder) NewInternalAppWithToken

func (ab *AppClientBuilder) NewInternalAppWithToken(id uint, token string) *model.Application

NewInternalAppWithToken creates an internal application with a token and returns the app.

func (*AppClientBuilder) NewInternalAppWithTokenAndName

func (ab *AppClientBuilder) NewInternalAppWithTokenAndName(id uint, token, name string) *model.Application

NewInternalAppWithTokenAndName creates an internal application with a token and name and returns the app.

type Database

type Database struct {
	*database.GormDatabase
	// contains filtered or unexported fields
}

Database is the wrapper for the gorm database with sleek helper methods.

func NewDB

func NewDB(t *testing.T) *Database

NewDB creates a new test db instance.

func NewDBWithDefaultUser

func NewDBWithDefaultUser(t *testing.T) *Database

NewDBWithDefaultUser creates a new test db instance with the default user.

func (*Database) AdminUser added in v3.1.1

func (d *Database) AdminUser(id uint) *AppClientBuilder

AdminUser creates an admin user and returns a builder for applications and clients.

func (*Database) AssertAppExist

func (d *Database) AssertAppExist(id uint)

AssertAppExist asserts that the app does exist.

func (*Database) AssertAppNotExist

func (d *Database) AssertAppNotExist(id uint)

AssertAppNotExist asserts that the app does not exist.

func (*Database) AssertClientExist

func (d *Database) AssertClientExist(id uint)

AssertClientExist asserts that the client does exist.

func (*Database) AssertClientNotExist

func (d *Database) AssertClientNotExist(id uint)

AssertClientNotExist asserts that the client does not exist.

func (*Database) AssertMessageExist

func (d *Database) AssertMessageExist(id uint)

AssertMessageExist asserts that the message does exist.

func (*Database) AssertMessageNotExist

func (d *Database) AssertMessageNotExist(ids ...uint)

AssertMessageNotExist asserts that the messages does not exist.

func (*Database) AssertUserExist

func (d *Database) AssertUserExist(id uint)

AssertUserExist asserts that the user does exist.

func (*Database) AssertUserNotExist

func (d *Database) AssertUserNotExist(id uint)

AssertUserNotExist asserts that the user does not exist.

func (*Database) AssertUsernameNotExist

func (d *Database) AssertUsernameNotExist(name string)

AssertUsernameNotExist asserts that the user does not exist.

func (*Database) NewUser

func (d *Database) NewUser(id uint) *model.User

NewUser creates a user and returns the user.

func (*Database) NewUserWithName

func (d *Database) NewUserWithName(id uint, name string) *model.User

NewUserWithName creates a user with a name and returns the user.

func (*Database) User

func (d *Database) User(id uint) *AppClientBuilder

User creates a user and returns a builder for applications and clients.

type MessageBuilder

type MessageBuilder struct {
	// contains filtered or unexported fields
}

MessageBuilder has helper methods to create messages.

func (*MessageBuilder) Message

func (mb *MessageBuilder) Message(id uint) *MessageBuilder

Message creates a message and returns itself.

func (*MessageBuilder) NewMessage

func (mb *MessageBuilder) NewMessage(id uint) model.Message

NewMessage creates a message and returns the message.

Jump to

Keyboard shortcuts

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