Documentation
¶
Index ¶
- func IsExternalServiceErr(err error) bool
- func IsInvalidArgumentErr(err error) bool
- func IsModelExistErr(err error) bool
- func IsModelNotExistErr(err error) bool
- func IsModelValidationErr(err error) bool
- type ClientService
- type ClientTx
- type DB
- type MockDB
- type MockService
- func (_m *MockService) CallPatient(_a0 *model.Patient) error
- func (_m *MockService) ChangeUserPassword(_a0 *model.User) error
- func (_m *MockService) CreateClient(_a0 *model.Client) error
- func (_m *MockService) CreatePatient(_a0 *model.Patient) error
- func (_m *MockService) CreateToken(_a0 *model.Token) error
- func (_m *MockService) CreateUser(_a0 *model.User) error
- func (_m *MockService) DeletePatient(_a0 *model.Patient) error
- func (_m *MockService) DeleteToken(_a0 *model.Token) error
- func (_m *MockService) ListClients() ([]*model.Client, error)
- func (_m *MockService) ListPagerPatientsByStatus(_a0 ...model.PatientStatus) ([]*model.Patient, error)
- func (_m *MockService) ListPagers() ([]*model.Pager, error)
- func (_m *MockService) ListPatients() ([]*model.Patient, error)
- func (_m *MockService) ListTokensByUser(_a0 string) ([]*model.Token, error)
- func (_m *MockService) ListUsers() ([]*model.User, error)
- func (_m *MockService) Login(_a0 string, _a1 string) (*model.User, bool, error)
- func (_m *MockService) ShowClient(_a0 uint) (*model.Client, error)
- func (_m *MockService) ShowClientByUser(_a0 string) (*model.Client, error)
- func (_m *MockService) ShowPager(_a0 uint) (*model.Pager, error)
- func (_m *MockService) ShowPatient(_a0 uint) (*model.Patient, error)
- func (_m *MockService) ShowToken(_a0 string) (*model.Token, error)
- func (_m *MockService) ShowUser(_a0 string) (*model.User, error)
- func (_m *MockService) ShowUserByToken(_a0 string) (*model.User, error)
- func (_m *MockService) UpdatePatient(_a0 *model.Patient) error
- type MockTx
- func (_m *MockTx) AddClient(_a0 *model.Client) error
- func (_m *MockTx) AddPatient(_a0 *model.Patient) error
- func (_m *MockTx) AddToken(_a0 *model.Token) error
- func (_m *MockTx) AddUser(_a0 *model.User) error
- func (_m *MockTx) Commit() error
- func (_m *MockTx) GetClient(_a0 uint) (*model.Client, error)
- func (_m *MockTx) GetClientByUser(_a0 string) (*model.Client, error)
- func (_m *MockTx) GetClients() ([]*model.Client, error)
- func (_m *MockTx) GetPager(_a0 uint) (*model.Pager, error)
- func (_m *MockTx) GetPagers() ([]*model.Pager, error)
- func (_m *MockTx) GetPatient(_a0 uint) (*model.Patient, error)
- func (_m *MockTx) GetPatients() ([]*model.Patient, error)
- func (_m *MockTx) GetPatientsByClient(_a0 uint, _a1 ...bool) ([]*model.Patient, error)
- func (_m *MockTx) GetPatientsWithPagerByStatus(_a0 ...model.PatientStatus) ([]*model.Patient, error)
- func (_m *MockTx) GetToken(_a0 string) (*model.Token, error)
- func (_m *MockTx) GetTokensByUser(_a0 string) ([]*model.Token, error)
- func (_m *MockTx) GetUnassignedPagers() ([]*model.Pager, error)
- func (_m *MockTx) GetUser(_a0 string) (*model.User, error)
- func (_m *MockTx) GetUserByToken(_a0 string) (*model.User, error)
- func (_m *MockTx) GetUsers() ([]*model.User, error)
- func (_m *MockTx) MarkPatientsInactiveByClient(_a0 uint) error
- func (_m *MockTx) RemovePatient(_a0 *model.Patient) error
- func (_m *MockTx) RemovePatientsByClient(_a0 uint, _a1 ...bool) error
- func (_m *MockTx) RemoveToken(_a0 *model.Token) error
- func (_m *MockTx) Rollback() error
- func (_m *MockTx) UpdatePatient(_a0 *model.Patient) error
- func (_m *MockTx) UpdateUserPassword(_a0 *model.User) error
- type PagerService
- type PagerTx
- type PatientService
- type PatientTx
- type Service
- type TokenService
- type TokenTx
- type Tx
- type UINotifier
- type UserService
- type UserTx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExternalServiceErr ¶
IsExternalServiceErr returns true if external service raises an error
func IsInvalidArgumentErr ¶
IsInvalidArgumentErr returns true if a given argument is invalid
func IsModelExistErr ¶
IsModelExistErr returns true if model already exists
func IsModelNotExistErr ¶
IsModelNotExistErr returns true if model does not exist
func IsModelValidationErr ¶
IsModelValidationErr returns true if model is invalid
Types ¶
type ClientService ¶
type ClientService interface { ListClients() ([]*model.Client, error) ShowClient(uint) (*model.Client, error) ShowClientByUser(string) (*model.Client, error) CreateClient(*model.Client) error }
ClientService interface
type ClientTx ¶
type ClientTx interface { GetClients() ([]*model.Client, error) GetClient(uint) (*model.Client, error) GetClientByUser(string) (*model.Client, error) AddClient(*model.Client) error }
ClientTx interface
type MockService ¶
MockService is an autogenerated mock type for the Service type
func (*MockService) CallPatient ¶
func (_m *MockService) CallPatient(_a0 *model.Patient) error
CallPatient provides a mock function with given fields: _a0
func (*MockService) ChangeUserPassword ¶
func (_m *MockService) ChangeUserPassword(_a0 *model.User) error
ChangeUserPassword provides a mock function with given fields: _a0
func (*MockService) CreateClient ¶
func (_m *MockService) CreateClient(_a0 *model.Client) error
CreateClient provides a mock function with given fields: _a0
func (*MockService) CreatePatient ¶
func (_m *MockService) CreatePatient(_a0 *model.Patient) error
CreatePatient provides a mock function with given fields: _a0
func (*MockService) CreateToken ¶
func (_m *MockService) CreateToken(_a0 *model.Token) error
CreateToken provides a mock function with given fields: _a0
func (*MockService) CreateUser ¶
func (_m *MockService) CreateUser(_a0 *model.User) error
CreateUser provides a mock function with given fields: _a0
func (*MockService) DeletePatient ¶
func (_m *MockService) DeletePatient(_a0 *model.Patient) error
DeletePatient provides a mock function with given fields: _a0
func (*MockService) DeleteToken ¶
func (_m *MockService) DeleteToken(_a0 *model.Token) error
DeleteToken provides a mock function with given fields: _a0
func (*MockService) ListClients ¶
func (_m *MockService) ListClients() ([]*model.Client, error)
ListClients provides a mock function with given fields:
func (*MockService) ListPagerPatientsByStatus ¶
func (_m *MockService) ListPagerPatientsByStatus(_a0 ...model.PatientStatus) ([]*model.Patient, error)
ListPagerPatientsByStatus provides a mock function with given fields: _a0
func (*MockService) ListPagers ¶
func (_m *MockService) ListPagers() ([]*model.Pager, error)
ListPagers provides a mock function with given fields:
func (*MockService) ListPatients ¶
func (_m *MockService) ListPatients() ([]*model.Patient, error)
ListPatients provides a mock function with given fields:
func (*MockService) ListTokensByUser ¶
func (_m *MockService) ListTokensByUser(_a0 string) ([]*model.Token, error)
ListTokensByUser provides a mock function with given fields: _a0
func (*MockService) ListUsers ¶
func (_m *MockService) ListUsers() ([]*model.User, error)
ListUsers provides a mock function with given fields:
func (*MockService) ShowClient ¶
func (_m *MockService) ShowClient(_a0 uint) (*model.Client, error)
ShowClient provides a mock function with given fields: _a0
func (*MockService) ShowClientByUser ¶
func (_m *MockService) ShowClientByUser(_a0 string) (*model.Client, error)
ShowClientByUser provides a mock function with given fields: _a0
func (*MockService) ShowPager ¶
func (_m *MockService) ShowPager(_a0 uint) (*model.Pager, error)
ShowPager provides a mock function with given fields: _a0
func (*MockService) ShowPatient ¶
func (_m *MockService) ShowPatient(_a0 uint) (*model.Patient, error)
ShowPatient provides a mock function with given fields: _a0
func (*MockService) ShowToken ¶
func (_m *MockService) ShowToken(_a0 string) (*model.Token, error)
ShowToken provides a mock function with given fields: _a0
func (*MockService) ShowUser ¶
func (_m *MockService) ShowUser(_a0 string) (*model.User, error)
ShowUser provides a mock function with given fields: _a0
func (*MockService) ShowUserByToken ¶
func (_m *MockService) ShowUserByToken(_a0 string) (*model.User, error)
ShowUserByToken provides a mock function with given fields: _a0
func (*MockService) UpdatePatient ¶
func (_m *MockService) UpdatePatient(_a0 *model.Patient) error
UpdatePatient provides a mock function with given fields: _a0
type MockTx ¶
MockTx is an autogenerated mock type for the Tx type
func (*MockTx) AddPatient ¶
AddPatient provides a mock function with given fields: _a0
func (*MockTx) GetClientByUser ¶
GetClientByUser provides a mock function with given fields: _a0
func (*MockTx) GetClients ¶
GetClients provides a mock function with given fields:
func (*MockTx) GetPatient ¶
GetPatient provides a mock function with given fields: _a0
func (*MockTx) GetPatients ¶
GetPatients provides a mock function with given fields:
func (*MockTx) GetPatientsByClient ¶
GetPatientsByClient provides a mock function with given fields: _a0, _a1
func (*MockTx) GetPatientsWithPagerByStatus ¶
func (_m *MockTx) GetPatientsWithPagerByStatus(_a0 ...model.PatientStatus) ([]*model.Patient, error)
GetPatientsWithPagerByStatus provides a mock function with given fields: _a0
func (*MockTx) GetTokensByUser ¶
GetTokensByUser provides a mock function with given fields: _a0
func (*MockTx) GetUnassignedPagers ¶
GetUnassignedPagers provides a mock function with given fields:
func (*MockTx) GetUserByToken ¶
GetUserByToken provides a mock function with given fields: _a0
func (*MockTx) MarkPatientsInactiveByClient ¶
MarkPatientsInactiveByClient provides a mock function with given fields: _a0
func (*MockTx) RemovePatient ¶
RemovePatient provides a mock function with given fields: _a0
func (*MockTx) RemovePatientsByClient ¶
RemovePatientsByClient provides a mock function with given fields: _a0, _a1
func (*MockTx) RemoveToken ¶
RemoveToken provides a mock function with given fields: _a0
func (*MockTx) UpdatePatient ¶
UpdatePatient provides a mock function with given fields: _a0
type PagerService ¶
type PagerService interface { ListPagers() ([]*model.Pager, error) ShowPager(uint) (*model.Pager, error) CreatePager(*model.Pager) error }
PagerService interface
type PagerTx ¶
type PagerTx interface { GetPagers() ([]*model.Pager, error) GetUnassignedPagers() ([]*model.Pager, error) GetPager(uint) (*model.Pager, error) AddPager(*model.Pager) error }
PagerTx interface
type PatientService ¶
type PatientService interface { ListPatients() ([]*model.Patient, error) ListPagerPatientsByStatus(...model.PatientStatus) ([]*model.Patient, error) ShowPatient(uint) (*model.Patient, error) CreatePatient(*model.Patient) error UpdatePatient(*model.Patient) error DeletePatient(*model.Patient) error CallPatient(*model.Patient) error }
PatientService interface
type PatientTx ¶
type PatientTx interface { GetPatients() ([]*model.Patient, error) GetPatientsWithPagerByStatus(...model.PatientStatus) ([]*model.Patient, error) // Get Patients by Client, Activity (first in slice) and Assignment of a Pager (second in slice) GetPatientsByClient(uint, ...bool) ([]*model.Patient, error) GetPatient(uint) (*model.Patient, error) AddPatient(*model.Patient) error UpdatePatient(*model.Patient) error MarkPatientsInactiveByClient(uint) error RemovePatient(*model.Patient) error // Remove Patients by Client, Activity (first in slice) and Assignment of a Pager (second in slice) RemovePatientsByClient(uint, ...bool) error }
PatientTx interface
type Service ¶
type Service interface { ClientService PagerService PatientService TokenService UserService }
Service interface combines all concrete model services
func NewService ¶
func NewService(db DB, notifier UINotifier) Service
NewService constructs a new service layer
type TokenService ¶
type TokenService interface { ListTokensByUser(string) ([]*model.Token, error) ShowToken(string) (*model.Token, error) CreateToken(*model.Token) error DeleteToken(*model.Token) error }
TokenService interface
type TokenTx ¶
type TokenTx interface { GetToken(string) (*model.Token, error) GetTokensByUser(string) ([]*model.Token, error) AddToken(*model.Token) error RemoveToken(*model.Token) error }
TokenTx interface
type UINotifier ¶
type UINotifier interface { NotifyNewPatient(*model.Patient) NotifyUpdatedPatient(*model.Patient) NotifyDeletedPatient(*model.Patient) }
UINotifier interface for async view updates
type UserService ¶
type UserService interface { ListUsers() ([]*model.User, error) ShowUser(string) (*model.User, error) ShowUserByToken(string) (*model.User, error) CreateUser(*model.User) error ChangeUserPassword(*model.User) error Login(string, string) (*model.User, bool, error) }
UserService interface