Documentation ¶
Index ¶
- func ConvertParamToActionBackend(parameter string) string
- func ConvertParamToNodeRunBackend(parameter string) string
- func ConvertParamToNodeStateBackendLowerFilter(parameter string) string
- func FormatActionFilters(filters []string) (map[string][]string, error)
- func StringDateRangeToTime(date string) (time.Time, bool)
- func StringDateTimeRangeToTime(date string) (time.Time, bool)
- func ValidSuggestionParam(field string) bool
- func ValidateDateRange(start string, end string) bool
- func ValidateDateTimeRange(start, end string) bool
- func ValidateMillsecondDateRange(start int64, end int64) (time.Time, time.Time, error)
- func ValidatePagingCursorTime(before int64, after int64, cursor string, end int64) (time.Time, bool, error)
- type SuggestionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertParamToActionBackend ¶
ConvertParamToActionBackend Transforms a parameter provided by consumers into a parameter that the 'backend' can understand.
func ConvertParamToNodeRunBackend ¶
ConvertParamToNodeRunBackend Transforms a parameter provided by consumers into a parameter that the 'backend' can understand.
This is used for query of the node-state only for sorting and the converge-history index.
func ConvertParamToNodeStateBackendLowerFilter ¶
ConvertParamToNodeStateBackendLowerFilter - The fields for the Elasticsearch mapping of node-state index. This is using the ".lower" values to match on fields case-insensitively
func FormatActionFilters ¶
FormatActionFilters Will receive an array of filters and will format them into a map of strings To be used on filtering Actions.
Example:
[ "environment:adios", "environment:hola", "cookbook:awesome", "roles:lalala", ]
The returned filters would look like:
map[string][]string [
"environment": ["adios","hola"], "cookbook": ["awesome"], "roles": ["lalala"],
]
func StringDateRangeToTime ¶
StringDateRangeToTime will transform a Date Range (start/end) to a Time type it verifies that it has a specific layout
The format we want is: YYYY-MM-DD
func ValidSuggestionParam ¶
func ValidateDateRange ¶
ValidateDateRange will validate that the provided start & end date are valid. That means they both have to have the right format and the start time must be less than or equal to the end time
NOTE: If start or end are empty strings ("") that's consider an ok "empty" parameter
func ValidateDateTimeRange ¶
ValidateDateTimeRange will validate that the provided start & end date are valid. That means they both have to have the right format and the start time must be less than or equal to the end time
NOTE: If start or end are empty strings ("") that's consider an ok "empty" parameter
func ValidateMillsecondDateRange ¶
ValidateMillsecondDateRange will validate that the provided start & end date are valid. That means the start time must be less than or equal to the end time
NOTE: If start or end are 0 that's consider an ok "empty" parameter
Types ¶
type SuggestionType ¶
type SuggestionType int
const ( PlatformSug SuggestionType = iota NameSug EnvironmentSug PolicyGroupSug PolicyNameSug PolicyRevisionSug CookbooksSug RecipesSug ResourceNamesSug AttributesSug RolesSug ChefVersionSug ChefTagsSug ErrorSug OrganizationSug ChefServerSug )
Ended these constants with sug so that they do not get mixed up with other parameter validation constants