manager

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabaseIfNotExist

func CreateDatabaseIfNotExist(db *pg.DB, p *config.PostgresConfig)

CreateDatabaseIfNotExist creates our postgresql database from postgres config

func CreateDatabaseUserIfNotExist

func CreateDatabaseUserIfNotExist(db *pg.DB, p *config.PostgresConfig)

CreateDatabaseUserIfNotExist creates a database user

func CreateSchema

func CreateSchema(db *pg.DB, models ...interface{})

CreateSchema creates the tables for given models

func GetModels

func GetModels() []interface{}

GetModels retrieve models

func GetType

func GetType(myvar interface{}) string

GetType is a useful utility function to help us inspect the name of a model (struct) which is expressed as an interface{}

Types

type Manager

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

Manager holds a group of methods for writing tests

func NewManager

func NewManager(accountRepo *repository.AccountRepo, roleRepo *repository.RoleRepo, db *pg.DB) *Manager

NewManager returns a new manager

func (*Manager) CreateRoles

func (m *Manager) CreateRoles()

CreateRoles is a thin wrapper for roleRepo.CreateRoles(), which populates our roles table

func (*Manager) CreateSchema

func (m *Manager) CreateSchema(models ...interface{})

CreateSchema creates tables declared as models (struct)

func (*Manager) CreateSuperAdmin

func (m *Manager) CreateSuperAdmin(email, password string) (*model.User, error)

CreateSuperAdmin is used to create a user object with superadmin role

Jump to

Keyboard shortcuts

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