Safe Haskell | None |
---|
Implementation of the Ganeti Query2 basic types.
These are types internal to the library, and for example clients that use the library should not need to import it.
Synopsis
- data FieldGetter a b
- = FieldSimple (a -> ResultEntry)
- | FieldRuntime (b -> a -> ResultEntry)
- | FieldConfig (ConfigData -> a -> ResultEntry)
- | FieldConfigRuntime (ConfigData -> b -> a -> ResultEntry)
- | FieldUnknown
- data QffMode
- type FieldData a b = (FieldDefinition, FieldGetter a b, QffMode)
- type FieldList a b = [FieldData a b]
- type FieldMap a b = Map String (FieldData a b)
- isRuntimeField :: FieldGetter a b -> Bool
- fieldListToFieldMap :: FieldList a b -> FieldMap a b
Documentation
data FieldGetter a b Source #
The type of field getters. The "a" type represents the type we're querying, whereas the "b" type represents the 'runtime' data for that type (if any). Note that we don't support multiple runtime sources, and we always consider the entire configuration as a given (so no equivalent for Python's *_CONFIG and *_GROUP; configuration accesses are cheap for us).
FieldSimple (a -> ResultEntry) | |
FieldRuntime (b -> a -> ResultEntry) | |
FieldConfig (ConfigData -> a -> ResultEntry) | |
FieldConfigRuntime (ConfigData -> b -> a -> ResultEntry) | |
FieldUnknown |
Type defining how the value of a field is used in filtering. This implements the equivalent to Python's QFF_ flags, except that we don't use OR-able values.
QffNormal | Value is used as-is in filters |
QffTimestamp | Value is a timestamp tuple, convert to float |
QffHostname | Value is a hostname, compare it smartly |
type FieldData a b = (FieldDefinition, FieldGetter a b, QffMode) Source #
Alias for a field data (definition and getter).
isRuntimeField :: FieldGetter a b -> Bool Source #
Helper function to check if a getter is a runtime one.
fieldListToFieldMap :: FieldList a b -> FieldMap a b Source #
Helper function to obtain a FieldMap from the corresponding FieldList.