Documentation ¶
Overview ¶
Package repositories is a generated GoMock package.
Index ¶
- Variables
- func CombineDateAndTime(date time.Time, timePart time.Time) time.Time
- func ToDomainClient(client RepoClient) models.Client
- func ToDomainSession(repoSession RepoSession) models.Session
- type ClientRepository
- type DateOnly
- type GORMClientRepository
- func (repo *GORMClientRepository) Delete(client *models.Client) error
- func (repo *GORMClientRepository) GetAll() ([]models.Client, error)
- func (repo *GORMClientRepository) GetByName(name string) (*models.Client, error)
- func (repo *GORMClientRepository) Insert(client *models.Client) error
- func (repo *GORMClientRepository) Rename(client *models.Client, newName string) error
- func (repo *GORMClientRepository) SafeGetByName(name string) (*models.Client, error)
- func (repo *GORMClientRepository) Update(client *models.Client) error
- type GORMSessionRepository
- func (repo *GORMSessionRepository) Delete(session *models.Session, dryRun bool) error
- func (repo *GORMSessionRepository) GetAllSessions(client models.Client) (*[]models.Session, error)
- func (repo *GORMSessionRepository) GetAllSessionsAllClients() (*[]models.Session, error)
- func (repo *GORMSessionRepository) GetAllSessionsBetweenDates(start time.Time, end time.Time) (*[]models.Session, error)
- func (repo *GORMSessionRepository) GetLastSessions(count uint32, client *models.Client) (*[]models.Session, error)
- func (repo *GORMSessionRepository) GetLatestSession() (*models.Session, error)
- func (repo *GORMSessionRepository) GetLatestSessionOnSpecificDate(date time.Time, client models.Client) (*models.Session, error)
- func (repo *GORMSessionRepository) GetLatestSessionOnSpecificDateAllClients(date time.Time) (*[]models.Session, error)
- func (repo *GORMSessionRepository) GetSessionByID(id uint32) (*models.Session, error)
- func (repo *GORMSessionRepository) Insert(session *models.Session, dryRun bool) error
- func (repo *GORMSessionRepository) Update(session *models.Session, dryRun bool) error
- func (repo *GORMSessionRepository) Upsert(session *models.Session, dryRun bool) error
- type MockClientRepository
- func (m *MockClientRepository) Delete(client *models.Client) error
- func (m *MockClientRepository) EXPECT() *MockClientRepositoryMockRecorder
- func (m *MockClientRepository) GetAll() ([]models.Client, error)
- func (m *MockClientRepository) GetByName(name string) (*models.Client, error)
- func (m *MockClientRepository) Insert(client *models.Client) error
- func (m *MockClientRepository) Rename(client *models.Client, newName string) error
- func (m *MockClientRepository) SafeGetByName(name string) (*models.Client, error)
- func (m *MockClientRepository) Update(client *models.Client) error
- type MockClientRepositoryMockRecorder
- func (mr *MockClientRepositoryMockRecorder) Delete(client interface{}) *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) GetAll() *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) GetByName(name interface{}) *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) Insert(client interface{}) *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) Rename(client, newName interface{}) *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) SafeGetByName(name interface{}) *gomock.Call
- func (mr *MockClientRepositoryMockRecorder) Update(client interface{}) *gomock.Call
- type MockSessionRepository
- func (m *MockSessionRepository) Delete(session *models.Session, dryRun bool) error
- func (m *MockSessionRepository) EXPECT() *MockSessionRepositoryMockRecorder
- func (m *MockSessionRepository) GetAllSessions(client models.Client) (*[]models.Session, error)
- func (m *MockSessionRepository) GetAllSessionsAllClients() (*[]models.Session, error)
- func (m *MockSessionRepository) GetAllSessionsBetweenDates(start, end time.Time) (*[]models.Session, error)
- func (m *MockSessionRepository) GetLastSessions(arg0 uint32, arg1 *models.Client) (*[]models.Session, error)
- func (m *MockSessionRepository) GetLatestSession() (*models.Session, error)
- func (m *MockSessionRepository) GetLatestSessionOnSpecificDate(date time.Time, client models.Client) (*models.Session, error)
- func (m *MockSessionRepository) GetLatestSessionOnSpecificDateAllClients(date time.Time) (*[]models.Session, error)
- func (m *MockSessionRepository) GetSessionByID(id uint32) (*models.Session, error)
- func (m *MockSessionRepository) Insert(session *models.Session, dryRun bool) error
- func (m *MockSessionRepository) Update(session *models.Session, dryRun bool) error
- func (m *MockSessionRepository) Upsert(session *models.Session, dryRun bool) error
- type MockSessionRepositoryMockRecorder
- func (mr *MockSessionRepositoryMockRecorder) Delete(session, dryRun interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetAllSessions(client interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetAllSessionsAllClients() *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetAllSessionsBetweenDates(start, end interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetLastSessions(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetLatestSession() *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDate(date, client interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDateAllClients(date interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) GetSessionByID(id interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) Insert(session, dryRun interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) Update(session, dryRun interface{}) *gomock.Call
- func (mr *MockSessionRepositoryMockRecorder) Upsert(session, dryRun interface{}) *gomock.Call
- type RepoClient
- type RepoSession
- type SessionRepository
- type TimeOnly
Constants ¶
This section is empty.
Variables ¶
var ( ErrSessionNotFound = errors.New("Session record not found") ConflictingIdsError = errors.New("Session already exists with a different ID") InfoConflictError = errors.New("Session exists with different info") )
var ErrClientNotFound = errors.New("record not found")
Functions ¶
func ToDomainClient ¶
func ToDomainClient(client RepoClient) models.Client
func ToDomainSession ¶
func ToDomainSession(repoSession RepoSession) models.Session
Types ¶
type ClientRepository ¶
type ClientRepository interface { GetAll() ([]models.Client, error) Insert(client *models.Client) error Delete(client *models.Client) error GetByName(name string) (*models.Client, error) SafeGetByName(name string) (*models.Client, error) Rename(client *models.Client, newName string) error Update(client *models.Client) error }
type DateOnly ¶
func ToDateOnly ¶
type GORMClientRepository ¶
type GORMClientRepository struct {
// contains filtered or unexported fields
}
func NewGORMClientRepository ¶
func NewGORMClientRepository(db *gorm.DB) *GORMClientRepository
func (*GORMClientRepository) Delete ¶
func (repo *GORMClientRepository) Delete(client *models.Client) error
func (*GORMClientRepository) GetAll ¶
func (repo *GORMClientRepository) GetAll() ([]models.Client, error)
func (*GORMClientRepository) GetByName ¶
func (repo *GORMClientRepository) GetByName(name string) (*models.Client, error)
func (*GORMClientRepository) Insert ¶
func (repo *GORMClientRepository) Insert(client *models.Client) error
func (*GORMClientRepository) Rename ¶
func (repo *GORMClientRepository) Rename(client *models.Client, newName string) error
func (*GORMClientRepository) SafeGetByName ¶
func (repo *GORMClientRepository) SafeGetByName(name string) (*models.Client, error)
type GORMSessionRepository ¶
type GORMSessionRepository struct {
// contains filtered or unexported fields
}
func NewGORMSessionRepository ¶
func NewGORMSessionRepository(db *gorm.DB) *GORMSessionRepository
func (*GORMSessionRepository) Delete ¶
func (repo *GORMSessionRepository) Delete(session *models.Session, dryRun bool) error
func (*GORMSessionRepository) GetAllSessions ¶
func (*GORMSessionRepository) GetAllSessionsAllClients ¶
func (repo *GORMSessionRepository) GetAllSessionsAllClients() (*[]models.Session, error)
func (*GORMSessionRepository) GetAllSessionsBetweenDates ¶
func (*GORMSessionRepository) GetLastSessions ¶
func (*GORMSessionRepository) GetLatestSession ¶
func (repo *GORMSessionRepository) GetLatestSession() (*models.Session, error)
func (*GORMSessionRepository) GetLatestSessionOnSpecificDate ¶
func (*GORMSessionRepository) GetLatestSessionOnSpecificDateAllClients ¶
func (*GORMSessionRepository) GetSessionByID ¶
func (repo *GORMSessionRepository) GetSessionByID(id uint32) (*models.Session, error)
func (*GORMSessionRepository) Insert ¶
func (repo *GORMSessionRepository) Insert(session *models.Session, dryRun bool) error
type MockClientRepository ¶
type MockClientRepository struct {
// contains filtered or unexported fields
}
MockClientRepository is a mock of ClientRepository interface.
func NewMockClientRepository ¶
func NewMockClientRepository(ctrl *gomock.Controller) *MockClientRepository
NewMockClientRepository creates a new mock instance.
func (*MockClientRepository) Delete ¶
func (m *MockClientRepository) Delete(client *models.Client) error
Delete mocks base method.
func (*MockClientRepository) EXPECT ¶
func (m *MockClientRepository) EXPECT() *MockClientRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClientRepository) GetAll ¶
func (m *MockClientRepository) GetAll() ([]models.Client, error)
GetAll mocks base method.
func (*MockClientRepository) GetByName ¶
func (m *MockClientRepository) GetByName(name string) (*models.Client, error)
GetByName mocks base method.
func (*MockClientRepository) Insert ¶
func (m *MockClientRepository) Insert(client *models.Client) error
Insert mocks base method.
func (*MockClientRepository) Rename ¶
func (m *MockClientRepository) Rename(client *models.Client, newName string) error
Rename mocks base method.
func (*MockClientRepository) SafeGetByName ¶
func (m *MockClientRepository) SafeGetByName(name string) (*models.Client, error)
SafeGetByName mocks base method.
type MockClientRepositoryMockRecorder ¶
type MockClientRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockClientRepositoryMockRecorder is the mock recorder for MockClientRepository.
func (*MockClientRepositoryMockRecorder) Delete ¶
func (mr *MockClientRepositoryMockRecorder) Delete(client interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockClientRepositoryMockRecorder) GetAll ¶
func (mr *MockClientRepositoryMockRecorder) GetAll() *gomock.Call
GetAll indicates an expected call of GetAll.
func (*MockClientRepositoryMockRecorder) GetByName ¶
func (mr *MockClientRepositoryMockRecorder) GetByName(name interface{}) *gomock.Call
GetByName indicates an expected call of GetByName.
func (*MockClientRepositoryMockRecorder) Insert ¶
func (mr *MockClientRepositoryMockRecorder) Insert(client interface{}) *gomock.Call
Insert indicates an expected call of Insert.
func (*MockClientRepositoryMockRecorder) Rename ¶
func (mr *MockClientRepositoryMockRecorder) Rename(client, newName interface{}) *gomock.Call
Rename indicates an expected call of Rename.
func (*MockClientRepositoryMockRecorder) SafeGetByName ¶
func (mr *MockClientRepositoryMockRecorder) SafeGetByName(name interface{}) *gomock.Call
SafeGetByName indicates an expected call of SafeGetByName.
func (*MockClientRepositoryMockRecorder) Update ¶
func (mr *MockClientRepositoryMockRecorder) Update(client interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockSessionRepository ¶
type MockSessionRepository struct {
// contains filtered or unexported fields
}
MockSessionRepository is a mock of SessionRepository interface.
func NewMockSessionRepository ¶
func NewMockSessionRepository(ctrl *gomock.Controller) *MockSessionRepository
NewMockSessionRepository creates a new mock instance.
func (*MockSessionRepository) Delete ¶
func (m *MockSessionRepository) Delete(session *models.Session, dryRun bool) error
Delete mocks base method.
func (*MockSessionRepository) EXPECT ¶
func (m *MockSessionRepository) EXPECT() *MockSessionRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSessionRepository) GetAllSessions ¶
GetAllSessions mocks base method.
func (*MockSessionRepository) GetAllSessionsAllClients ¶
func (m *MockSessionRepository) GetAllSessionsAllClients() (*[]models.Session, error)
GetAllSessionsAllClients mocks base method.
func (*MockSessionRepository) GetAllSessionsBetweenDates ¶
func (m *MockSessionRepository) GetAllSessionsBetweenDates(start, end time.Time) (*[]models.Session, error)
GetAllSessionsBetweenDates mocks base method.
func (*MockSessionRepository) GetLastSessions ¶
func (m *MockSessionRepository) GetLastSessions(arg0 uint32, arg1 *models.Client) (*[]models.Session, error)
GetLastSessions mocks base method.
func (*MockSessionRepository) GetLatestSession ¶
func (m *MockSessionRepository) GetLatestSession() (*models.Session, error)
GetLatestSession mocks base method.
func (*MockSessionRepository) GetLatestSessionOnSpecificDate ¶
func (m *MockSessionRepository) GetLatestSessionOnSpecificDate(date time.Time, client models.Client) (*models.Session, error)
GetLatestSessionOnSpecificDate mocks base method.
func (*MockSessionRepository) GetLatestSessionOnSpecificDateAllClients ¶
func (m *MockSessionRepository) GetLatestSessionOnSpecificDateAllClients(date time.Time) (*[]models.Session, error)
GetLatestSessionOnSpecificDateAllClients mocks base method.
func (*MockSessionRepository) GetSessionByID ¶
func (m *MockSessionRepository) GetSessionByID(id uint32) (*models.Session, error)
GetSessionByID mocks base method.
func (*MockSessionRepository) Insert ¶
func (m *MockSessionRepository) Insert(session *models.Session, dryRun bool) error
Insert mocks base method.
type MockSessionRepositoryMockRecorder ¶
type MockSessionRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockSessionRepositoryMockRecorder is the mock recorder for MockSessionRepository.
func (*MockSessionRepositoryMockRecorder) Delete ¶
func (mr *MockSessionRepositoryMockRecorder) Delete(session, dryRun interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockSessionRepositoryMockRecorder) GetAllSessions ¶
func (mr *MockSessionRepositoryMockRecorder) GetAllSessions(client interface{}) *gomock.Call
GetAllSessions indicates an expected call of GetAllSessions.
func (*MockSessionRepositoryMockRecorder) GetAllSessionsAllClients ¶
func (mr *MockSessionRepositoryMockRecorder) GetAllSessionsAllClients() *gomock.Call
GetAllSessionsAllClients indicates an expected call of GetAllSessionsAllClients.
func (*MockSessionRepositoryMockRecorder) GetAllSessionsBetweenDates ¶
func (mr *MockSessionRepositoryMockRecorder) GetAllSessionsBetweenDates(start, end interface{}) *gomock.Call
GetAllSessionsBetweenDates indicates an expected call of GetAllSessionsBetweenDates.
func (*MockSessionRepositoryMockRecorder) GetLastSessions ¶
func (mr *MockSessionRepositoryMockRecorder) GetLastSessions(arg0, arg1 interface{}) *gomock.Call
GetLastSessions indicates an expected call of GetLastSessions.
func (*MockSessionRepositoryMockRecorder) GetLatestSession ¶
func (mr *MockSessionRepositoryMockRecorder) GetLatestSession() *gomock.Call
GetLatestSession indicates an expected call of GetLatestSession.
func (*MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDate ¶
func (mr *MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDate(date, client interface{}) *gomock.Call
GetLatestSessionOnSpecificDate indicates an expected call of GetLatestSessionOnSpecificDate.
func (*MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDateAllClients ¶
func (mr *MockSessionRepositoryMockRecorder) GetLatestSessionOnSpecificDateAllClients(date interface{}) *gomock.Call
GetLatestSessionOnSpecificDateAllClients indicates an expected call of GetLatestSessionOnSpecificDateAllClients.
func (*MockSessionRepositoryMockRecorder) GetSessionByID ¶
func (mr *MockSessionRepositoryMockRecorder) GetSessionByID(id interface{}) *gomock.Call
GetSessionByID indicates an expected call of GetSessionByID.
func (*MockSessionRepositoryMockRecorder) Insert ¶
func (mr *MockSessionRepositoryMockRecorder) Insert(session, dryRun interface{}) *gomock.Call
Insert indicates an expected call of Insert.
func (*MockSessionRepositoryMockRecorder) Update ¶
func (mr *MockSessionRepositoryMockRecorder) Update(session, dryRun interface{}) *gomock.Call
Update indicates an expected call of Update.
func (*MockSessionRepositoryMockRecorder) Upsert ¶
func (mr *MockSessionRepositoryMockRecorder) Upsert(session, dryRun interface{}) *gomock.Call
Upsert indicates an expected call of Upsert.
type RepoClient ¶
type RepoClient struct { Name string `gorm:"primaryKey;collate:NOCASE"` PPH uint16 Currency string }
func ToRepoClient ¶
func ToRepoClient(client models.Client) *RepoClient
type RepoSession ¶
type RepoSession struct { ID *uint32 `gorm:"primaryKey;autoIncrement"` ClientName string `gorm:"foreignKey:Name"` Start *time.Time End *time.Time Note string Client RepoClient `gorm:"foreignKey:ClientName;references:Name"` }
func ToRepoSession ¶
func ToRepoSession(session models.Session) RepoSession
type SessionRepository ¶
type SessionRepository interface { Insert(session *models.Session, dryRun bool) error Upsert(session *models.Session, dryRun bool) error Update(session *models.Session, dryRun bool) error Delete(session *models.Session, dryRun bool) error GetSessionByID(id uint32) (*models.Session, error) GetAllSessions(client models.Client) (*[]models.Session, error) GetAllSessionsBetweenDates(start time.Time, end time.Time) (*[]models.Session, error) GetAllSessionsAllClients() (*[]models.Session, error) GetLatestSession() (*models.Session, error) GetLatestSessionOnSpecificDate(date time.Time, client models.Client) (*models.Session, error) GetLatestSessionOnSpecificDateAllClients(date time.Time) (*[]models.Session, error) GetLastSessions(uint32, *models.Client) (*[]models.Session, error) }