Documentation ¶
Index ¶
- type Client
- type DB
- func (db *DB) AllClients(clients *[]Client) []error
- func (db *DB) AllUsers(users *[]User) []error
- func (db *DB) GetClientsByUsername(username string, clients *[]Client) []error
- func (db *DB) GetUserByEmail(email string, user *User) []error
- func (db *DB) GetUserByUsername(username string, user *User) []error
- type Datastore
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { gorm.Model UserID uint `gorm:"index"` // Foreign key (belongs to) ClientKey string ClientSecret string Description string }
Client is a mqtt client model
type DB ¶
DB is an instant hold database connection
func (*DB) AllClients ¶
AllClients list all clients
func (*DB) GetClientsByUsername ¶
GetClientsByUsername get clients of an user by give username
func (*DB) GetUserByEmail ¶
GetUserByEmail get user by give email
type Datastore ¶
type Datastore interface { AllUsers(*[]User) []error GetUserByUsername(string, *User) []error AllClients(*[]Client) []error GetClientsByUsername(string, *[]Client) []error }
Datastore interface for easily mock up
Click to show internal directories.
Click to hide internal directories.