Documentation
¶
Index ¶
- type AppClientBuilder
- func (ab *AppClientBuilder) App(id uint) *MessageBuilder
- func (ab *AppClientBuilder) AppWithToken(id uint, token string) *MessageBuilder
- func (ab *AppClientBuilder) AppWithTokenAndDefaultPriority(id uint, token string, defaultPriority int) *MessageBuilder
- func (ab *AppClientBuilder) AppWithTokenAndName(id uint, token, name string) *MessageBuilder
- func (ab *AppClientBuilder) Client(id uint) *AppClientBuilder
- func (ab *AppClientBuilder) ClientWithToken(id uint, token string) *AppClientBuilder
- func (ab *AppClientBuilder) InternalApp(id uint) *MessageBuilder
- func (ab *AppClientBuilder) InternalAppWithToken(id uint, token string) *MessageBuilder
- func (ab *AppClientBuilder) InternalAppWithTokenAndName(id uint, token, name string) *MessageBuilder
- func (ab *AppClientBuilder) NewAppWithToken(id uint, token string) *model.Application
- func (ab *AppClientBuilder) NewAppWithTokenAndName(id uint, token, name string) *model.Application
- func (ab *AppClientBuilder) NewClientWithToken(id uint, token string) *model.Client
- func (ab *AppClientBuilder) NewInternalAppWithToken(id uint, token string) *model.Application
- func (ab *AppClientBuilder) NewInternalAppWithTokenAndName(id uint, token, name string) *model.Application
- type Database
- func (d *Database) AssertAppExist(id uint)
- func (d *Database) AssertAppNotExist(id uint)
- func (d *Database) AssertClientExist(id uint)
- func (d *Database) AssertClientNotExist(id uint)
- func (d *Database) AssertMessageExist(id uint)
- func (d *Database) AssertMessageNotExist(ids ...uint)
- func (d *Database) AssertUserExist(id uint)
- func (d *Database) AssertUserNotExist(id uint)
- func (d *Database) AssertUsernameNotExist(name string)
- func (d *Database) NewUser(id uint) *model.User
- func (d *Database) NewUserWithName(id uint, name string) *model.User
- func (d *Database) User(id uint) *AppClientBuilder
- type MessageBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ¶ added in v2.3.0
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) 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) 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 NewDBWithDefaultUser ¶
NewDBWithDefaultUser creates a new test db instance with the default user.
func (*Database) AssertAppExist ¶
AssertAppExist asserts that the app does exist.
func (*Database) AssertAppNotExist ¶
AssertAppNotExist asserts that the app does not exist.
func (*Database) AssertClientExist ¶
AssertClientExist asserts that the client does exist.
func (*Database) AssertClientNotExist ¶
AssertClientNotExist asserts that the client does not exist.
func (*Database) AssertMessageExist ¶
AssertMessageExist asserts that the message does exist.
func (*Database) AssertMessageNotExist ¶
AssertMessageNotExist asserts that the messages does not exist.
func (*Database) AssertUserExist ¶
AssertUserExist asserts that the user does exist.
func (*Database) AssertUserNotExist ¶
AssertUserNotExist asserts that the user does not exist.
func (*Database) AssertUsernameNotExist ¶ added in v2.1.0
AssertUsernameNotExist asserts that the user does not exist.
func (*Database) NewUserWithName ¶
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.