Documentation ¶
Index ¶
- Constants
- func FormatFilters(filters []string) (map[string][]string, error)
- func GetPageParams(p *query.Pagination) (int32, int32)
- func GetSortParamsForServiceGroups(s *query.Sorting) (sortField string, sortAsc bool, err error)
- func GetSortParamsForServices(s *query.Sorting) (sortField string, sortAsc bool, err error)
- type SortField
Constants ¶
View Source
const ( DefaultPage int32 = 1 DefaultPageSize int32 = 25 )
View Source
const ( DefaultSortFieldForServiceGroups = "name" DefaultSortFieldForServices = "health" DefaultSortAscending = true // Define here your sort fields DefaultField SortField = iota PercentOkField NameField HealthField )
Variables ¶
This section is empty.
Functions ¶
func FormatFilters ¶
FormatFilters Will receive an array of filters and will format them into a map of strings
Example:
[ "status:critical", "service_name:redis", "service_name:postgres", "application:cafe", "environment:prod", ]
The returned filters would look like:
map[string][]string [
"status": ["critical"], "service_name": ["redis","postgres"], "application": ["cafe"], "environment": ["prod"]
] TODO: (afiune) Migrate this to a common go package that other teams can consume
func GetPageParams ¶
func GetPageParams(p *query.Pagination) (int32, int32)
func GetSortParamsForServiceGroups ¶
GetSortParamsForServiceGroups returns valid sorting parameters for service_groups from the sort query
Types ¶
Click to show internal directories.
Click to hide internal directories.