Safe Haskell | Safe-Infered |
---|
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.
- data FieldGetter a b
- = FieldSimple (a -> ResultEntry)
- | FieldRuntime (b -> a -> ResultEntry)
- | FieldConfig (ConfigData -> 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
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) | |
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 |
type FieldData a b = (FieldDefinition, FieldGetter a b, QffMode)Source
Alias for a field data (definition and getter).
isRuntimeField :: FieldGetter a b -> BoolSource
Helper function to check if a getter is a runtime one.