Documentation
¶
Index ¶
- func ParseTimeout(timeoutPart string) (value interface{}, err error)
- func ParseTimeoutToSeconds(timeoutPart string) (numSeconds int, err error)
- func Prepare(filenames ...string)
- func TimeoutParser(timeoutPart string, allowZero bool, allowedUnits []string) (value interface{}, err error)
- type AnnotationDefintion
- type AnnotationGrammer
- type Entry
- func (entry Entry) Exists(key string) (isPresent bool)
- func (entry Entry) Get(key string) (values []interface{}, exists bool)
- func (entry Entry) GetAsBool(key string) (boolvalue bool, exists bool)
- func (entry Entry) GetAsBools(key string) (boolvalues []bool, exists bool)
- func (entry Entry) GetAsInt(key string) (intvalue int, exists bool)
- func (entry Entry) GetAsInts(key string) (intvalues []int, exists bool)
- func (entry Entry) GetAsString(key string) (strvalue string, exists bool)
- func (entry Entry) GetAsStrings(key string) (strvalues []string, exists bool)
- func (entry Entry) GetAsValueUnitString(key string) (valueUnit string, exists bool)
- func (entry Entry) GetAsValueUnitStringArray(key string) (strvalues [2]string, exists bool)
- func (entry Entry) GetAsValueUnitStringArrays(key string) (strvalues [][2]string, exists bool)
- func (entry Entry) GetKeylessValue() (values []interface{}, exists bool)
- func (entry Entry) GetKeylessValueAsBool(fieldType string) (strvalue bool, exists bool)
- func (entry Entry) GetKeylessValueAsString(fieldType string) (strvalue string, exists bool)
- func (entry Entry) GetKeylessValueAsValueUnitString(fieldType string) (strvalue string, exists bool)
- func (entry Entry) Keyless() (isKeyless bool)
- func (entry Entry) Put(key string, value interface{})
- type ParseMethodDef
- type ParsedValidatedAnnotation
- func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueInt(fieldName string, fieldValue int) (selectedEntries []Entry, exists bool)
- func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueString(fieldName string, fieldValue string) (selectedEntries []Entry, exists bool)
- func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueUnitString(fieldName string, fieldValue string) (selectedEntries []Entry, exists bool)
- func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithSingleField(fieldName string) (selectedEntries []Entry, exists bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTimeout ¶
ParseTimeout converts any timeout input with "s" or "m " into seconds
func ParseTimeoutToSeconds ¶
ParseTimeoutToSeconds converts any timeout input with "s" or "m " into seconds
Types ¶
type AnnotationDefintion ¶
type AnnotationDefintion struct {
// contains filtered or unexported fields
}
AnnotationDefintion ...
type AnnotationGrammer ¶
type AnnotationGrammer struct { Definitions []struct { Label string `json:"label"` MandatoryFields []struct { Name string `json:"name"` Type string `json:"type"` } `json:"mandatoryFields"` AtleastoneFields []struct { Name string `json:"name"` Type string `json:"type"` } `json:"atleastoneFields"` OptionalFields []struct { Name string `json:"name"` Type string `json:"type"` } `json:"optionalFields"` StrictOrdering string `json:"strictOrdering,omitempty"` KeyLessEntry string `json:"keyLessEntry,omitempty"` } `json:"definition"` }
AnnotationGrammer ...
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry ... Output model
func NewKeylessEntry ¶
NewKeylessEntry ... Constructor For KeylessEntry
func (Entry) GetAsBool ¶
GetAsBool support for boolean values for example : proxy-buffering : True or false
func (Entry) GetAsBools ¶
GetAsBools support for multiple boolean values
func (Entry) GetAsInt ¶
GetAsInt Get the values of single Integer value for given fieldName for a given entry
func (Entry) GetAsInts ¶
GetAsInts Get the values of multiple Integer value for given fieldName for a given entry
func (Entry) GetAsString ¶
GetAsString Get the values of single string value for given fieldName for a given entry
func (Entry) GetAsStrings ¶
GetAsStrings Get the values of mutiple string vlaues for a given filedname for a given entry
func (Entry) GetAsValueUnitString ¶
GetAsValueUnitString Get the values of single string value having unit for given fieldName for a given entry ex : timeout,rate
func (Entry) GetAsValueUnitStringArray ¶
GetAsValueUnitStringArray Get the first array values of the multiple string having units of key
func (Entry) GetAsValueUnitStringArrays ¶
GetAsValueUnitStringArrays Get all the values of the strings values for the given field name
func (Entry) GetKeylessValue ¶
GetKeylessValue gets the keyless value of a given entry
func (Entry) GetKeylessValueAsBool ¶
GetKeylessValueAsBool Support for getting boolean value for keyless value
func (Entry) GetKeylessValueAsString ¶
GetKeylessValueAsString Support for getting string values for a given fieldType for example : "cafe.example.com"
func (Entry) GetKeylessValueAsValueUnitString ¶
func (entry Entry) GetKeylessValueAsValueUnitString(fieldType string) (strvalue string, exists bool)
GetKeylessValueAsValueUnitString Support for getting string unit values for a given fieldType for example : 10ms , 10r/s
type ParseMethodDef ¶
ParseMethodDef - Field Parser Defintion
type ParsedValidatedAnnotation ¶
type ParsedValidatedAnnotation struct { Entries []Entry // contains filtered or unexported fields }
ParsedValidatedAnnotation ...
func ParseInputForAnnotation ¶
func ParseInputForAnnotation(label string, input string) (parsedOutput ParsedValidatedAnnotation, err error)
ParseInputForAnnotation ...
func (ParsedValidatedAnnotation) GetEntriesWithFieldValueInt ¶
func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueInt(fieldName string, fieldValue int) (selectedEntries []Entry, exists bool)
GetEntriesWithFieldValueInt gets the entries which containing integer values
func (ParsedValidatedAnnotation) GetEntriesWithFieldValueString ¶
func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueString(fieldName string, fieldValue string) (selectedEntries []Entry, exists bool)
GetEntriesWithFieldValueString support only string values for example : serviceName
func (ParsedValidatedAnnotation) GetEntriesWithFieldValueUnitString ¶
func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithFieldValueUnitString(fieldName string, fieldValue string) (selectedEntries []Entry, exists bool)
GetEntriesWithFieldValueUnitString support only string values having units for example : timeout , rate
func (ParsedValidatedAnnotation) GetEntriesWithSingleField ¶
func (parsedValidatedAnnotation ParsedValidatedAnnotation) GetEntriesWithSingleField(fieldName string) (selectedEntries []Entry, exists bool)
GetEntriesWithSingleField gets entries with single string field for example : serviceName