Documentation
¶
Index ¶
- type HTTPHandler
- type Repository
- type RepositoryMock
- func (mock *RepositoryMock) CreateApp(id string, appId string, name string) error
- func (mock *RepositoryMock) CreateAppCalls() []struct{ ... }
- func (mock *RepositoryMock) DeleteAppById(id string) error
- func (mock *RepositoryMock) DeleteAppByIdCalls() []struct{ ... }
- func (mock *RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppID(appID string, message string) error
- func (mock *RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) DisableAllAppVersionsByAppID(appID string) error
- func (mock *RepositoryMock) DisableAllAppVersionsByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetActiveAppByAppID(appID string) (*models.App, error)
- func (mock *RepositoryMock) GetActiveAppByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetActiveAppByID(ID string) (*models.App, error)
- func (mock *RepositoryMock) GetActiveAppByIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetAppByAppID(appID string) (*models.App, error)
- func (mock *RepositoryMock) GetAppByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetAppVersionsByAppID(ID string) (*[]models.Version, error)
- func (mock *RepositoryMock) GetAppVersionsByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetApps() (*[]models.App, error)
- func (mock *RepositoryMock) GetAppsCalls() []struct{}
- func (mock *RepositoryMock) GetDeviceByDeviceIDAndAppID(deviceID string, appID string) (*models.Device, error)
- func (mock *RepositoryMock) GetDeviceByDeviceIDAndAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetDeviceByVersionAndAppID(versionID string, appID string) (*models.Device, error)
- func (mock *RepositoryMock) GetDeviceByVersionAndAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) GetVersionByAppIDAndVersion(appID string, versionNumber string) (*models.Version, error)
- func (mock *RepositoryMock) GetVersionByAppIDAndVersionCalls() []struct{ ... }
- func (mock *RepositoryMock) InsertDeviceOrUpdateVersionID(device models.Device) error
- func (mock *RepositoryMock) InsertDeviceOrUpdateVersionIDCalls() []struct{ ... }
- func (mock *RepositoryMock) UnDeleteAppByAppID(appID string) error
- func (mock *RepositoryMock) UnDeleteAppByAppIDCalls() []struct{ ... }
- func (mock *RepositoryMock) UpdateAppNameByID(id string, name string) error
- func (mock *RepositoryMock) UpdateAppNameByIDCalls() []struct{ ... }
- func (mock *RepositoryMock) UpdateAppVersions(versions []models.Version) error
- func (mock *RepositoryMock) UpdateAppVersionsCalls() []struct{ ... }
- func (mock *RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunched(version *models.Version) error
- func (mock *RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunchedCalls() []struct{ ... }
- type Service
- type ServiceMock
- func (mock *ServiceMock) CreateApp(app models.App) error
- func (mock *ServiceMock) CreateAppCalls() []struct{ ... }
- func (mock *ServiceMock) DeleteAppById(id string) error
- func (mock *ServiceMock) DeleteAppByIdCalls() []struct{ ... }
- func (mock *ServiceMock) DisableAllAppVersionsByAppID(id string, message string) error
- func (mock *ServiceMock) DisableAllAppVersionsByAppIDCalls() []struct{ ... }
- func (mock *ServiceMock) GetActiveAppByAppID(appId string) (*models.App, error)
- func (mock *ServiceMock) GetActiveAppByAppIDCalls() []struct{ ... }
- func (mock *ServiceMock) GetActiveAppByID(ID string) (*models.App, error)
- func (mock *ServiceMock) GetActiveAppByIDCalls() []struct{ ... }
- func (mock *ServiceMock) GetApps() (*[]models.App, error)
- func (mock *ServiceMock) GetAppsCalls() []struct{}
- func (mock *ServiceMock) InitClientApp(deviceInfo *models.Device) (*models.Version, error)
- func (mock *ServiceMock) InitClientAppCalls() []struct{ ... }
- func (mock *ServiceMock) UpdateAppNameByID(id string, name string) error
- func (mock *ServiceMock) UpdateAppNameByIDCalls() []struct{ ... }
- func (mock *ServiceMock) UpdateAppVersions(id string, versions []models.Version) error
- func (mock *ServiceMock) UpdateAppVersionsCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
type HTTPHandler interface { GetApps(c echo.Context) error GetActiveAppByID(c echo.Context) error UpdateAppVersions(c echo.Context) error DisableAllAppVersionsByAppID(c echo.Context) error DeleteAppById(c echo.Context) error CreateApp(c echo.Context) error UpdateAppNameByID(c echo.Context) error }
func NewHTTPHandler ¶
func NewHTTPHandler(e *echo.Echo, s Service) HTTPHandler
NewHTTPHandler returns a new instance of app.Handler
type Repository ¶
type Repository interface { GetApps() (*[]models.App, error) GetActiveAppByID(ID string) (*models.App, error) GetAppVersionsByAppID(ID string) (*[]models.Version, error) UpdateAppVersions(versions []models.Version) error DisableAllAppVersionsByAppID(appID string) error DisableAllAppVersionsAndSetDisabledMessageByAppID(appID, message string) error DeleteAppById(id string) error CreateApp(id, appId, name string) error GetAppByAppID(appID string) (*models.App, error) GetActiveAppByAppID(appID string) (*models.App, error) UnDeleteAppByAppID(appID string) error UpdateAppNameByID(id string, name string) error GetVersionByAppIDAndVersion(appID string, versionNumber string) (*models.Version, error) GetDeviceByDeviceIDAndAppID(deviceID string, appID string) (*models.Device, error) GetDeviceByVersionAndAppID(versionID string, appID string) (*models.Device, error) UpsertVersionWithAppLaunchesAndLastLaunched(version *models.Version) error InsertDeviceOrUpdateVersionID(device models.Device) error }
Repository represent the app's repository contract
func NewPostgreSQLRepository ¶
func NewPostgreSQLRepository(db *sql.DB) Repository
NewPostgreSQLRepository creates a new instance of appsPostgreSQLRepository
type RepositoryMock ¶
type RepositoryMock struct { // CreateAppFunc mocks the CreateApp method. CreateAppFunc func(id string, appId string, name string) error // DeleteAppByIdFunc mocks the DeleteAppById method. DeleteAppByIdFunc func(id string) error // DisableAllAppVersionsAndSetDisabledMessageByAppIDFunc mocks the DisableAllAppVersionsAndSetDisabledMessageByAppID method. DisableAllAppVersionsAndSetDisabledMessageByAppIDFunc func(appID string, message string) error // DisableAllAppVersionsByAppIDFunc mocks the DisableAllAppVersionsByAppID method. DisableAllAppVersionsByAppIDFunc func(appID string) error // GetActiveAppByAppIDFunc mocks the GetActiveAppByAppID method. GetActiveAppByAppIDFunc func(appID string) (*models.App, error) // GetActiveAppByIDFunc mocks the GetActiveAppByID method. GetActiveAppByIDFunc func(ID string) (*models.App, error) // GetAppByAppIDFunc mocks the GetAppByAppID method. GetAppByAppIDFunc func(appID string) (*models.App, error) // GetAppVersionsByAppIDFunc mocks the GetAppVersionsByAppID method. GetAppVersionsByAppIDFunc func(ID string) (*[]models.Version, error) // GetAppsFunc mocks the GetApps method. GetAppsFunc func() (*[]models.App, error) // GetDeviceByDeviceIDAndAppIDFunc mocks the GetDeviceByDeviceIDAndAppID method. GetDeviceByDeviceIDAndAppIDFunc func(deviceID string, appID string) (*models.Device, error) // GetDeviceByVersionAndAppIDFunc mocks the GetDeviceByVersionAndAppID method. GetDeviceByVersionAndAppIDFunc func(versionID string, appID string) (*models.Device, error) // GetVersionByAppIDAndVersionFunc mocks the GetVersionByAppIDAndVersion method. GetVersionByAppIDAndVersionFunc func(appID string, versionNumber string) (*models.Version, error) // InsertDeviceOrUpdateVersionIDFunc mocks the InsertDeviceOrUpdateVersionID method. InsertDeviceOrUpdateVersionIDFunc func(device models.Device) error // UnDeleteAppByAppIDFunc mocks the UnDeleteAppByAppID method. UnDeleteAppByAppIDFunc func(appID string) error // UpdateAppNameByIDFunc mocks the UpdateAppNameByID method. UpdateAppNameByIDFunc func(id string, name string) error // UpdateAppVersionsFunc mocks the UpdateAppVersions method. UpdateAppVersionsFunc func(versions []models.Version) error // UpsertVersionWithAppLaunchesAndLastLaunchedFunc mocks the UpsertVersionWithAppLaunchesAndLastLaunched method. UpsertVersionWithAppLaunchesAndLastLaunchedFunc func(version *models.Version) error // contains filtered or unexported fields }
RepositoryMock is a mock implementation of Repository.
func TestSomethingThatUsesRepository(t *testing.T) { // make and configure a mocked Repository mockedRepository := &RepositoryMock{ CreateAppFunc: func(id string, appId string, name string) error { panic("mock out the CreateApp method") }, DeleteAppByIdFunc: func(id string) error { panic("mock out the DeleteAppById method") }, DisableAllAppVersionsAndSetDisabledMessageByAppIDFunc: func(appID string, message string) error { panic("mock out the DisableAllAppVersionsAndSetDisabledMessageByAppID method") }, DisableAllAppVersionsByAppIDFunc: func(appID string) error { panic("mock out the DisableAllAppVersionsByAppID method") }, GetActiveAppByAppIDFunc: func(appID string) (*models.App, error) { panic("mock out the GetActiveAppByAppID method") }, GetActiveAppByIDFunc: func(ID string) (*models.App, error) { panic("mock out the GetActiveAppByID method") }, GetAppByAppIDFunc: func(appID string) (*models.App, error) { panic("mock out the GetAppByAppID method") }, GetAppVersionsByAppIDFunc: func(ID string) (*[]models.Version, error) { panic("mock out the GetAppVersionsByAppID method") }, GetAppsFunc: func() (*[]models.App, error) { panic("mock out the GetApps method") }, GetDeviceByDeviceIDAndAppIDFunc: func(deviceID string, appID string) (*models.Device, error) { panic("mock out the GetDeviceByDeviceIDAndAppID method") }, GetDeviceByVersionAndAppIDFunc: func(versionID string, appID string) (*models.Device, error) { panic("mock out the GetDeviceByVersionAndAppID method") }, GetVersionByAppIDAndVersionFunc: func(appID string, versionNumber string) (*models.Version, error) { panic("mock out the GetVersionByAppIDAndVersion method") }, InsertDeviceOrUpdateVersionIDFunc: func(device models.Device) error { panic("mock out the InsertDeviceOrUpdateVersionID method") }, UnDeleteAppByAppIDFunc: func(appID string) error { panic("mock out the UnDeleteAppByAppID method") }, UpdateAppNameByIDFunc: func(id string, name string) error { panic("mock out the UpdateAppNameByID method") }, UpdateAppVersionsFunc: func(versions []models.Version) error { panic("mock out the UpdateAppVersions method") }, UpsertVersionWithAppLaunchesAndLastLaunchedFunc: func(version *models.Version) error { panic("mock out the UpsertVersionWithAppLaunchesAndLastLaunched method") }, } // use mockedRepository in code that requires Repository // and then make assertions. }
func (*RepositoryMock) CreateApp ¶
func (mock *RepositoryMock) CreateApp(id string, appId string, name string) error
CreateApp calls CreateAppFunc.
func (*RepositoryMock) CreateAppCalls ¶
func (mock *RepositoryMock) CreateAppCalls() []struct { ID string AppId string Name string }
CreateAppCalls gets all the calls that were made to CreateApp. Check the length with:
len(mockedRepository.CreateAppCalls())
func (*RepositoryMock) DeleteAppById ¶
func (mock *RepositoryMock) DeleteAppById(id string) error
DeleteAppById calls DeleteAppByIdFunc.
func (*RepositoryMock) DeleteAppByIdCalls ¶
func (mock *RepositoryMock) DeleteAppByIdCalls() []struct { ID string }
DeleteAppByIdCalls gets all the calls that were made to DeleteAppById. Check the length with:
len(mockedRepository.DeleteAppByIdCalls())
func (*RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppID ¶
func (mock *RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppID(appID string, message string) error
DisableAllAppVersionsAndSetDisabledMessageByAppID calls DisableAllAppVersionsAndSetDisabledMessageByAppIDFunc.
func (*RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppIDCalls ¶
func (mock *RepositoryMock) DisableAllAppVersionsAndSetDisabledMessageByAppIDCalls() []struct { AppID string Message string }
DisableAllAppVersionsAndSetDisabledMessageByAppIDCalls gets all the calls that were made to DisableAllAppVersionsAndSetDisabledMessageByAppID. Check the length with:
len(mockedRepository.DisableAllAppVersionsAndSetDisabledMessageByAppIDCalls())
func (*RepositoryMock) DisableAllAppVersionsByAppID ¶
func (mock *RepositoryMock) DisableAllAppVersionsByAppID(appID string) error
DisableAllAppVersionsByAppID calls DisableAllAppVersionsByAppIDFunc.
func (*RepositoryMock) DisableAllAppVersionsByAppIDCalls ¶
func (mock *RepositoryMock) DisableAllAppVersionsByAppIDCalls() []struct { AppID string }
DisableAllAppVersionsByAppIDCalls gets all the calls that were made to DisableAllAppVersionsByAppID. Check the length with:
len(mockedRepository.DisableAllAppVersionsByAppIDCalls())
func (*RepositoryMock) GetActiveAppByAppID ¶
func (mock *RepositoryMock) GetActiveAppByAppID(appID string) (*models.App, error)
GetActiveAppByAppID calls GetActiveAppByAppIDFunc.
func (*RepositoryMock) GetActiveAppByAppIDCalls ¶
func (mock *RepositoryMock) GetActiveAppByAppIDCalls() []struct { AppID string }
GetActiveAppByAppIDCalls gets all the calls that were made to GetActiveAppByAppID. Check the length with:
len(mockedRepository.GetActiveAppByAppIDCalls())
func (*RepositoryMock) GetActiveAppByID ¶
func (mock *RepositoryMock) GetActiveAppByID(ID string) (*models.App, error)
GetActiveAppByID calls GetActiveAppByIDFunc.
func (*RepositoryMock) GetActiveAppByIDCalls ¶
func (mock *RepositoryMock) GetActiveAppByIDCalls() []struct { ID string }
GetActiveAppByIDCalls gets all the calls that were made to GetActiveAppByID. Check the length with:
len(mockedRepository.GetActiveAppByIDCalls())
func (*RepositoryMock) GetAppByAppID ¶
func (mock *RepositoryMock) GetAppByAppID(appID string) (*models.App, error)
GetAppByAppID calls GetAppByAppIDFunc.
func (*RepositoryMock) GetAppByAppIDCalls ¶
func (mock *RepositoryMock) GetAppByAppIDCalls() []struct { AppID string }
GetAppByAppIDCalls gets all the calls that were made to GetAppByAppID. Check the length with:
len(mockedRepository.GetAppByAppIDCalls())
func (*RepositoryMock) GetAppVersionsByAppID ¶
func (mock *RepositoryMock) GetAppVersionsByAppID(ID string) (*[]models.Version, error)
GetAppVersionsByAppID calls GetAppVersionsByAppIDFunc.
func (*RepositoryMock) GetAppVersionsByAppIDCalls ¶
func (mock *RepositoryMock) GetAppVersionsByAppIDCalls() []struct { ID string }
GetAppVersionsByAppIDCalls gets all the calls that were made to GetAppVersionsByAppID. Check the length with:
len(mockedRepository.GetAppVersionsByAppIDCalls())
func (*RepositoryMock) GetApps ¶
func (mock *RepositoryMock) GetApps() (*[]models.App, error)
GetApps calls GetAppsFunc.
func (*RepositoryMock) GetAppsCalls ¶
func (mock *RepositoryMock) GetAppsCalls() []struct { }
GetAppsCalls gets all the calls that were made to GetApps. Check the length with:
len(mockedRepository.GetAppsCalls())
func (*RepositoryMock) GetDeviceByDeviceIDAndAppID ¶
func (mock *RepositoryMock) GetDeviceByDeviceIDAndAppID(deviceID string, appID string) (*models.Device, error)
GetDeviceByDeviceIDAndAppID calls GetDeviceByDeviceIDAndAppIDFunc.
func (*RepositoryMock) GetDeviceByDeviceIDAndAppIDCalls ¶
func (mock *RepositoryMock) GetDeviceByDeviceIDAndAppIDCalls() []struct { DeviceID string AppID string }
GetDeviceByDeviceIDAndAppIDCalls gets all the calls that were made to GetDeviceByDeviceIDAndAppID. Check the length with:
len(mockedRepository.GetDeviceByDeviceIDAndAppIDCalls())
func (*RepositoryMock) GetDeviceByVersionAndAppID ¶
func (mock *RepositoryMock) GetDeviceByVersionAndAppID(versionID string, appID string) (*models.Device, error)
GetDeviceByVersionAndAppID calls GetDeviceByVersionAndAppIDFunc.
func (*RepositoryMock) GetDeviceByVersionAndAppIDCalls ¶
func (mock *RepositoryMock) GetDeviceByVersionAndAppIDCalls() []struct { VersionID string AppID string }
GetDeviceByVersionAndAppIDCalls gets all the calls that were made to GetDeviceByVersionAndAppID. Check the length with:
len(mockedRepository.GetDeviceByVersionAndAppIDCalls())
func (*RepositoryMock) GetVersionByAppIDAndVersion ¶
func (mock *RepositoryMock) GetVersionByAppIDAndVersion(appID string, versionNumber string) (*models.Version, error)
GetVersionByAppIDAndVersion calls GetVersionByAppIDAndVersionFunc.
func (*RepositoryMock) GetVersionByAppIDAndVersionCalls ¶
func (mock *RepositoryMock) GetVersionByAppIDAndVersionCalls() []struct { AppID string VersionNumber string }
GetVersionByAppIDAndVersionCalls gets all the calls that were made to GetVersionByAppIDAndVersion. Check the length with:
len(mockedRepository.GetVersionByAppIDAndVersionCalls())
func (*RepositoryMock) InsertDeviceOrUpdateVersionID ¶
func (mock *RepositoryMock) InsertDeviceOrUpdateVersionID(device models.Device) error
InsertDeviceOrUpdateVersionID calls InsertDeviceOrUpdateVersionIDFunc.
func (*RepositoryMock) InsertDeviceOrUpdateVersionIDCalls ¶
func (mock *RepositoryMock) InsertDeviceOrUpdateVersionIDCalls() []struct { Device models.Device }
InsertDeviceOrUpdateVersionIDCalls gets all the calls that were made to InsertDeviceOrUpdateVersionID. Check the length with:
len(mockedRepository.InsertDeviceOrUpdateVersionIDCalls())
func (*RepositoryMock) UnDeleteAppByAppID ¶
func (mock *RepositoryMock) UnDeleteAppByAppID(appID string) error
UnDeleteAppByAppID calls UnDeleteAppByAppIDFunc.
func (*RepositoryMock) UnDeleteAppByAppIDCalls ¶
func (mock *RepositoryMock) UnDeleteAppByAppIDCalls() []struct { AppID string }
UnDeleteAppByAppIDCalls gets all the calls that were made to UnDeleteAppByAppID. Check the length with:
len(mockedRepository.UnDeleteAppByAppIDCalls())
func (*RepositoryMock) UpdateAppNameByID ¶
func (mock *RepositoryMock) UpdateAppNameByID(id string, name string) error
UpdateAppNameByID calls UpdateAppNameByIDFunc.
func (*RepositoryMock) UpdateAppNameByIDCalls ¶
func (mock *RepositoryMock) UpdateAppNameByIDCalls() []struct { ID string Name string }
UpdateAppNameByIDCalls gets all the calls that were made to UpdateAppNameByID. Check the length with:
len(mockedRepository.UpdateAppNameByIDCalls())
func (*RepositoryMock) UpdateAppVersions ¶
func (mock *RepositoryMock) UpdateAppVersions(versions []models.Version) error
UpdateAppVersions calls UpdateAppVersionsFunc.
func (*RepositoryMock) UpdateAppVersionsCalls ¶
func (mock *RepositoryMock) UpdateAppVersionsCalls() []struct { Versions []models.Version }
UpdateAppVersionsCalls gets all the calls that were made to UpdateAppVersions. Check the length with:
len(mockedRepository.UpdateAppVersionsCalls())
func (*RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunched ¶
func (mock *RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunched(version *models.Version) error
UpsertVersionWithAppLaunchesAndLastLaunched calls UpsertVersionWithAppLaunchesAndLastLaunchedFunc.
func (*RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunchedCalls ¶
func (mock *RepositoryMock) UpsertVersionWithAppLaunchesAndLastLaunchedCalls() []struct { Version *models.Version }
UpsertVersionWithAppLaunchesAndLastLaunchedCalls gets all the calls that were made to UpsertVersionWithAppLaunchesAndLastLaunched. Check the length with:
len(mockedRepository.UpsertVersionWithAppLaunchesAndLastLaunchedCalls())
type Service ¶
type Service interface { GetApps() (*[]models.App, error) GetActiveAppByID(ID string) (*models.App, error) GetActiveAppByAppID(appID string) (*models.App, error) UpdateAppVersions(id string, versions []models.Version) error DisableAllAppVersionsByAppID(id string, message string) error DeleteAppById(id string) error CreateApp(app models.App) error UpdateAppNameByID(id, name string) error InitClientApp(deviceInfo *models.Device) (*models.Version, error) }
Service defines the interface methods to be used
func NewService ¶
func NewService(repository Repository) Service
NewService instantiates this service
type ServiceMock ¶
type ServiceMock struct { // CreateAppFunc mocks the CreateApp method. CreateAppFunc func(app models.App) error // DeleteAppByIdFunc mocks the DeleteAppById method. DeleteAppByIdFunc func(id string) error // DisableAllAppVersionsByAppIDFunc mocks the DisableAllAppVersionsByAppID method. DisableAllAppVersionsByAppIDFunc func(id string, message string) error // GetActiveAppByAppIDFunc mocks the GetActiveAppByAppID method. GetActiveAppByAppIDFunc func(appId string) (*models.App, error) // GetActiveAppByIDFunc mocks the GetActiveAppByID method. GetActiveAppByIDFunc func(ID string) (*models.App, error) // GetAppsFunc mocks the GetApps method. GetAppsFunc func() (*[]models.App, error) // InitClientAppFunc mocks the InitClientApp method. InitClientAppFunc func(deviceInfo *models.Device) (*models.Version, error) // UpdateAppNameByIDFunc mocks the UpdateAppNameByID method. UpdateAppNameByIDFunc func(id string, name string) error // UpdateAppVersionsFunc mocks the UpdateAppVersions method. UpdateAppVersionsFunc func(id string, versions []models.Version) error // contains filtered or unexported fields }
ServiceMock is a mock implementation of Service.
func TestSomethingThatUsesService(t *testing.T) { // make and configure a mocked Service mockedService := &ServiceMock{ CreateAppFunc: func(app models.App) error { panic("mock out the CreateApp method") }, DeleteAppByIdFunc: func(id string) error { panic("mock out the DeleteAppById method") }, DisableAllAppVersionsByAppIDFunc: func(id string, message string) error { panic("mock out the DisableAllAppVersionsByAppID method") }, GetActiveAppByAppIDFunc: func(appId string) (*models.App, error) { panic("mock out the GetActiveAppByAppID method") }, GetActiveAppByIDFunc: func(ID string) (*models.App, error) { panic("mock out the GetActiveAppByID method") }, GetAppsFunc: func() (*[]models.App, error) { panic("mock out the GetApps method") }, InitClientAppFunc: func(deviceInfo *models.Device) (*models.Version, error) { panic("mock out the InitClientApp method") }, UpdateAppNameByIDFunc: func(id string, name string) error { panic("mock out the UpdateAppNameByID method") }, UpdateAppVersionsFunc: func(id string, versions []models.Version) error { panic("mock out the UpdateAppVersions method") }, } // use mockedService in code that requires Service // and then make assertions. }
func (*ServiceMock) CreateApp ¶
func (mock *ServiceMock) CreateApp(app models.App) error
CreateApp calls CreateAppFunc.
func (*ServiceMock) CreateAppCalls ¶
func (mock *ServiceMock) CreateAppCalls() []struct { App models.App }
CreateAppCalls gets all the calls that were made to CreateApp. Check the length with:
len(mockedService.CreateAppCalls())
func (*ServiceMock) DeleteAppById ¶
func (mock *ServiceMock) DeleteAppById(id string) error
DeleteAppById calls DeleteAppByIdFunc.
func (*ServiceMock) DeleteAppByIdCalls ¶
func (mock *ServiceMock) DeleteAppByIdCalls() []struct { ID string }
DeleteAppByIdCalls gets all the calls that were made to DeleteAppById. Check the length with:
len(mockedService.DeleteAppByIdCalls())
func (*ServiceMock) DisableAllAppVersionsByAppID ¶
func (mock *ServiceMock) DisableAllAppVersionsByAppID(id string, message string) error
DisableAllAppVersionsByAppID calls DisableAllAppVersionsByAppIDFunc.
func (*ServiceMock) DisableAllAppVersionsByAppIDCalls ¶
func (mock *ServiceMock) DisableAllAppVersionsByAppIDCalls() []struct { ID string Message string }
DisableAllAppVersionsByAppIDCalls gets all the calls that were made to DisableAllAppVersionsByAppID. Check the length with:
len(mockedService.DisableAllAppVersionsByAppIDCalls())
func (*ServiceMock) GetActiveAppByAppID ¶
func (mock *ServiceMock) GetActiveAppByAppID(appId string) (*models.App, error)
GetActiveAppByAppID calls GetActiveAppByAppIDFunc.
func (*ServiceMock) GetActiveAppByAppIDCalls ¶
func (mock *ServiceMock) GetActiveAppByAppIDCalls() []struct { AppId string }
GetActiveAppByAppIDCalls gets all the calls that were made to GetActiveAppByAppID. Check the length with:
len(mockedService.GetActiveAppByAppIDCalls())
func (*ServiceMock) GetActiveAppByID ¶
func (mock *ServiceMock) GetActiveAppByID(ID string) (*models.App, error)
GetActiveAppByID calls GetActiveAppByIDFunc.
func (*ServiceMock) GetActiveAppByIDCalls ¶
func (mock *ServiceMock) GetActiveAppByIDCalls() []struct { ID string }
GetActiveAppByIDCalls gets all the calls that were made to GetActiveAppByID. Check the length with:
len(mockedService.GetActiveAppByIDCalls())
func (*ServiceMock) GetApps ¶
func (mock *ServiceMock) GetApps() (*[]models.App, error)
GetApps calls GetAppsFunc.
func (*ServiceMock) GetAppsCalls ¶
func (mock *ServiceMock) GetAppsCalls() []struct { }
GetAppsCalls gets all the calls that were made to GetApps. Check the length with:
len(mockedService.GetAppsCalls())
func (*ServiceMock) InitClientApp ¶
InitClientApp calls InitClientAppFunc.
func (*ServiceMock) InitClientAppCalls ¶
func (mock *ServiceMock) InitClientAppCalls() []struct { DeviceInfo *models.Device }
InitClientAppCalls gets all the calls that were made to InitClientApp. Check the length with:
len(mockedService.InitClientAppCalls())
func (*ServiceMock) UpdateAppNameByID ¶
func (mock *ServiceMock) UpdateAppNameByID(id string, name string) error
UpdateAppNameByID calls UpdateAppNameByIDFunc.
func (*ServiceMock) UpdateAppNameByIDCalls ¶
func (mock *ServiceMock) UpdateAppNameByIDCalls() []struct { ID string Name string }
UpdateAppNameByIDCalls gets all the calls that were made to UpdateAppNameByID. Check the length with:
len(mockedService.UpdateAppNameByIDCalls())
func (*ServiceMock) UpdateAppVersions ¶
func (mock *ServiceMock) UpdateAppVersions(id string, versions []models.Version) error
UpdateAppVersions calls UpdateAppVersionsFunc.
func (*ServiceMock) UpdateAppVersionsCalls ¶
func (mock *ServiceMock) UpdateAppVersionsCalls() []struct { ID string Versions []models.Version }
UpdateAppVersionsCalls gets all the calls that were made to UpdateAppVersions. Check the length with:
len(mockedService.UpdateAppVersionsCalls())