-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
221 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package rpdac | ||
|
||
type MockDashboardService struct { | ||
GetDashboardM func(project string, id int) (*Dashboard, error) | ||
GetDashboardByNameM func(project, name string) (*Dashboard, error) | ||
CreateDashboardM func(project string, d *Dashboard) error | ||
ApplyDashboardM func(project string, d *Dashboard) error | ||
DeleteDashboardM func(project, name string) error | ||
} | ||
|
||
func (s *MockDashboardService) Get(project string, id int) (Object, error) { | ||
return s.GetDashboard(project, id) | ||
} | ||
func (s *MockDashboardService) GetDashboard(project string, id int) (*Dashboard, error) { | ||
return s.GetDashboardM(project, id) | ||
} | ||
func (s *MockDashboardService) GetDashboardByName(project, name string) (*Dashboard, error) { | ||
return s.GetDashboardByNameM(project, name) | ||
} | ||
func (s *MockDashboardService) CreateDashboard(project string, d *Dashboard) error { | ||
return s.CreateDashboardM(project, d) | ||
} | ||
func (s *MockDashboardService) ApplyDashboard(project string, d *Dashboard) error { | ||
return s.ApplyDashboardM(project, d) | ||
} | ||
func (s *MockDashboardService) DeleteDashboard(project, name string) error { | ||
return s.DeleteDashboardM(project, name) | ||
} | ||
|
||
type MockFilterService struct { | ||
GetFilterM func(project string, id int) (*Filter, error) | ||
GetFilterByNameM func(project, name string) (*Filter, error) | ||
CreateFilterM func(project string, f *Filter) error | ||
ApplyFilterM func(project string, f *Filter) error | ||
} | ||
|
||
func (s *MockFilterService) Get(project string, id int) (Object, error) { | ||
return s.GetFilter(project, id) | ||
} | ||
func (s *MockFilterService) GetFilter(project string, id int) (*Filter, error) { | ||
return s.GetFilterM(project, id) | ||
} | ||
func (s *MockFilterService) GetFilterByName(project, name string) (*Filter, error) { | ||
return s.GetFilterByNameM(project, name) | ||
} | ||
func (s *MockFilterService) CreateFilter(project string, f *Filter) error { | ||
return s.CreateFilterM(project, f) | ||
} | ||
func (s *MockFilterService) ApplyFilter(project string, f *Filter) error { | ||
return s.ApplyFilterM(project, f) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters