mockups

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApplicationsToDb

func AddApplicationsToDb(db *database.Database, apps []*model.Application) error

AddApplicationsToDb inserts the applications apps into the database db

func AddUsersToDb

func AddUsersToDb(db *database.Database, users []*model.User) ([]*model.User, error)

AddUsersToDb adds the users to the database and sets their username as a password, returns list of added users

func GetAdminUser

func GetAdminUser(c *configuration.Configuration) *model.User

GetAdminUser returns an admin user

func GetAllApplications

func GetAllApplications() []*model.Application

GetAllApplications returns all mock-applications as a list

func GetApplication1

func GetApplication1() *model.Application

GetApplication1 returns an application with id 1

func GetApplication2

func GetApplication2() *model.Application

GetApplication2 returns an application with id 2

func GetEmptyDatabase

func GetEmptyDatabase(confCrypto configuration.CryptoConfig) (*database.Database, error)

GetEmptyDatabase returns an empty sqlite database object

func GetUser

GetUser returns an user

func GetUsers

func GetUsers(c *configuration.Configuration) []*model.User

GetUsers returns a list of users

func ReadConfig

func ReadConfig(filename string, removeFile bool) (config *configuration.Configuration, err error)

ReadConfig copies the given filename to the current folder and parses it as a config file. RemoveFile indicates whether to remove the copied file or not

Types

type MockDispatcher

type MockDispatcher struct {
}

MockDispatcher is a dispatcher used for testing - it does not need any storage interface

func (*MockDispatcher) DeleteNotification added in v0.8.0

func (d *MockDispatcher) DeleteNotification(a *model.Application, n *model.DeleteNotification) error

func (*MockDispatcher) DeregisterApplication

func (d *MockDispatcher) DeregisterApplication(a *model.Application, u *model.User) error

func (*MockDispatcher) RegisterApplication

func (d *MockDispatcher) RegisterApplication(id uint, name, token, user string) (string, error)

func (*MockDispatcher) SendNotification added in v0.8.0

func (d *MockDispatcher) SendNotification(a *model.Application, n *model.Notification) (id string, err error)

func (*MockDispatcher) UpdateApplication

func (d *MockDispatcher) UpdateApplication(a *model.Application) error

Jump to

Keyboard shortcuts

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