Documentation ¶
Index ¶
- func MakeRequest(method string, url string, body interface{}, r *gin.Engine) (*httptest.ResponseRecorder, []byte)
- type StorageMock
- func (m *StorageMock) Free()
- func (m *StorageMock) GetAllMonitors(pageSize int64, pageIndex int64, contains string) ([]types.Monitor, error)
- func (m *StorageMock) GetAllTargets(pageSize int64, pageIndex int64, contains string) ([]*types.Target, error)
- func (m *StorageMock) GetMonitorByID(id string) (*types.Monitor, error)
- func (m *StorageMock) GetTargetByID(id string, includeChildren bool) (*types.Target, error)
- func (m *StorageMock) Init()
- func (m *StorageMock) InsertMonitor(monitor *types.Monitor) (*types.Monitor, error)
- func (m *StorageMock) InsertTarget(target *types.Target) (*types.Target, error)
- func (m *StorageMock) Login(email string, password string) error
- func (m *StorageMock) UpdateMonitor(oldMonitor *types.Monitor, newMonitor *types.Monitor) (*types.Monitor, error)
- func (m *StorageMock) UpdateTarget(oldTarget *types.Target, newTarget *types.Target, forceStatusUpdate bool) (*types.Target, error)
- func (m *StorageMock) UpdateTargetStatus(target *types.Target, targetPatch *types.TargetPatch) (*types.Target, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeRequest ¶
func MakeRequest(method string, url string, body interface{}, r *gin.Engine) (*httptest.ResponseRecorder, []byte)
MakeRequest to an http endpoint
Types ¶
type StorageMock ¶
type StorageMock struct { mock.Mock // TODO: This needs to be migrated to testify/mock way GetMonitorByIDResult *types.Monitor GetMonitorByIDError error GetAllMonitorsResult []types.Monitor GetAllMonitorsError error GetTargetByIDResult *types.Target GetTargetByIDError error GetAllTargetsResult []*types.Target GetAllTargetsError error InsertMonitorError error InsertTargetError error UpdateTargetStatusError error }
StorageMock is a mock for storage
func (*StorageMock) GetAllMonitors ¶
func (m *StorageMock) GetAllMonitors(pageSize int64, pageIndex int64, contains string) ([]types.Monitor, error)
GetAllMonitors returns mocked stuff
func (*StorageMock) GetAllTargets ¶
func (m *StorageMock) GetAllTargets(pageSize int64, pageIndex int64, contains string) ([]*types.Target, error)
GetAllTargets returns mocked stuff
func (*StorageMock) GetMonitorByID ¶
func (m *StorageMock) GetMonitorByID(id string) (*types.Monitor, error)
GetMonitorByID returns mocked stuff
func (*StorageMock) GetTargetByID ¶
GetTargetByID returns nothing
func (*StorageMock) InsertMonitor ¶
InsertMonitor in the db
func (*StorageMock) InsertTarget ¶
InsertTarget into the db.
func (*StorageMock) Login ¶
func (m *StorageMock) Login(email string, password string) error
UpdateTarget with also a status update force flag.
func (*StorageMock) UpdateMonitor ¶
func (m *StorageMock) UpdateMonitor(oldMonitor *types.Monitor, newMonitor *types.Monitor) (*types.Monitor, error)
UpdateMonitor with the modifyable fields.
func (*StorageMock) UpdateTarget ¶
func (m *StorageMock) UpdateTarget(oldTarget *types.Target, newTarget *types.Target, forceStatusUpdate bool) (*types.Target, error)
UpdateTarget with also a status update force flag.
func (*StorageMock) UpdateTargetStatus ¶
func (m *StorageMock) UpdateTargetStatus(target *types.Target, targetPatch *types.TargetPatch) (*types.Target, error)
UpdateTargetStatus with all modified fields
Click to show internal directories.
Click to hide internal directories.