Documentation
¶
Overview ¶
********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2017 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 -2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2017 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
Index ¶
- Constants
- Variables
- func AddNonRepeatingWords(s string, oldList, newList []string, imap map[string]int, plain, joiner string) string
- func AddStringListWithoutRepeats(src []string, newList []string) []string
- func ByteArrayEvaluatorAsInterface(data []byte, extraParams *dvevaluation.DvObject, source string) (interface{}, error)
- func CallInitBySettingFunc(parameters map[string]string, functionPool map[string]interface{})
- func CallInitBySettingFuncDefault()
- func CleanLogByteArray(data []byte) string
- func CleanLogString(data string) string
- func CloneGlobalProperties() map[string]string
- func ComposeParametersInTemplate(template string, brackets int, value string) (res map[string]string, ok bool)
- func ConvertByteArrayByGlobalProperties(data []byte, sourceName string) (res string, err error)
- func ConvertByteArrayByGlobalPropertiesInByteLines(data []byte, sourceName string) (res [][]byte, err error)
- func ConvertByteArrayByGlobalPropertiesInStringLines(data []byte, sourceName string) (res []string, err error)
- func ConvertByteArrayByGlobalPropertiesRuntime(data []byte, sourceName string) (res string, err error)
- func ConvertByteArrayBySpecificProperties(data []byte, sourceName string, properties map[string]string, ...) ([]byte, error)
- func ConvertByteArrayBySpecificPropertiesInLines(data []byte, sourceName string, properties map[string]string, ...) ([][]byte, error)
- func ConvertFileByGlobalProperties(fileName string) ([]byte, error)
- func ConvertStringArrayByGlobalProperties(data []string, sourceName string) (res []string, err error)
- func ConvertStringByGlobalProperties(data string, sourceName string) (string, error)
- func ConvertToList(lst string) []string
- func ConvertToNonEmptyList(lst string) []string
- func ConvertToNonEmptySemicolonList(lst string) []string
- func ConvertURLToList(url string) []string
- func CopyStringMap(src map[string]string) map[string]string
- func EvaluateDifferenceRate(model string, pattern string) int
- func ExtractFromBufByBeforeAfterKeys(data []byte, before []byte, after []byte) (res []byte, status int)
- func FindEol(data []byte) int
- func FindInGeneralPaths(name string) string
- func FindSubStringSmartInByteArray(data []byte, needle []byte) (int, int)
- func GetByGlobalPropertiesOrDefault(propName, defValue string) string
- func GetCanonicalVersion(version int64) string
- func GetCanonicalVersionFromHexName(version string) string
- func GetCommandLine() []string
- func GetGlobalPropertiesAsDvObject() *dvevaluation.DvObject
- func GetNextNonEmptyPartInYaml(s string) string
- func GetNextWordBySpaceTable(s string, spaceTable map[byte]bool, allRest bool) string
- func GetNextWordExceptYamlControls(s string) string
- func GetNextWordInText(s string) string
- func GetProptertiesPrototypedToGlobalProperties(localMap map[string]interface{}) *dvevaluation.DvObject
- func GetStringArrayWithDefaults(src []string, defs []string) []string
- func GetUnquotedString(data string) string
- func GetVersionIndex(version string) int64
- func InitAndReadCommandLine() []string
- func InsertTextIntoBuffer(src []byte, posStart int, posEnd int, buf ...[]byte) (dst []byte, dif int)
- func Int64ToFullHex(v int64) string
- func IsAlphabeticalLowCase(s string) bool
- func IsDigitOnly(s string) bool
- func JoinStringsWithClean(data []string) []byte
- func LinearSmartConfigFromEnvironment() map[string]string
- func LinearSmartConfigFromFile(fileName string, configInfo *ConfigInfo, level int)
- func LinearSmartConfigParse(data []byte, configInfo *ConfigInfo, sourceName string)
- func LoadSimpleMapFromByteArray(data []byte, separator byte) map[string]string
- func LoadSimpleMapFromFile(fileName string, separator byte) (res map[string]string, err error)
- func LogVariables(name string, vars map[string]string)
- func LookInDescriptionByteArray(data []byte, lookNames map[string]string, mustPresent bool) (res map[string]string, err error)
- func LookInDescriptionFile(fileName string, lookNames map[string]string, mustPresent bool) (res map[string]string, err error)
- func MakeUniqueStringList(lists ...[]string) []string
- func MatchParametersByVariableSubstitution(model string, list []string, rest []string, occurrence int, strict bool) (params map[string]string, doubt bool, ok bool)
- func PrepareAndMayQuoteParams(src []string) (string, int)
- func PresentMapAsProperties(pool map[string]string, outputFileName string) error
- func PrintInt64ToByteBuffer(n int64, b []byte) int
- func PutDescribedAttributesToMapFromCommaSeparatedList(params map[string]string, pool map[string]string, list string) error
- func PutDescribedAttributesToMapFromList(params map[string]string, pool map[string]string, list []string) error
- func QuickLookJsonOption(s string, option string) string
- func ReadHexValue(v string) int64
- func ReadInsideBrackets(str string, pos int) (endPos int, err error)
- func ReadPropertiesFileWithEnvironmentVariables(currentDir string, propertiesName string, setFilePaths func() error) error
- func ReadPropertiesFileWithEnvironmentVariablesInCurrentDirectory(propertiesName string) error
- func ReadPropertiesInEnvironment(name string) map[string]string
- func ReadPropertiesOrPanic(name string) map[string]string
- func ReduceListRestByKnownValueAtIndex(list []string, rest []string, index int, value string) ([]string, []string, int)
- func ReduceListToNonEmptyList(res []string) []string
- func ReduceSpaceAndCountWords(str string) (string, int)
- func RegisterInitBySettingFunc(initializer InitBySettingFunc) bool
- func RemoveGlobalPropertiesValue(key string)
- func ReplaceTextInsideByteArray(data []byte, start int, end int, replacement []byte) []byte
- func SeparateToKeyValue(line string) (key string, value string)
- func SetGlobalPropertiesValue(key string, value string)
- func SetMicroCorePrefix(prefix string)
- func SetNumberOfBracketsInConfigParsing(n int)
- func SetPrefixesByApplicationName(name string)
- func SmartReadFileAsString(fileName string, properties map[string]string) (string, error)
- func SmartReadTemplate(filename string, numberOfBrackets int, joiner byte) ([]byte, error)
- func SmartReadTemplateLines(fileName string, numberOfBrackets int, properties map[string]string) (lines [][]byte, err error, lastOutputMap map[string]string)
- func StringEvaluatorAsBoolean(data string, extraParams *dvevaluation.DvObject) (bool, error)
- func StringEvaluatorAsBooleanWithErrorLoggedAsWarning(data string, extraParams *dvevaluation.DvObject, defaultIfError bool) bool
- func StringEvaluatorAsString(data string, extraParams *dvevaluation.DvObject) (string, error)
- func StringEvaluatorAsStringWithErrorLoggedAsWarning(data string, extraParams *dvevaluation.DvObject, defaultIfError string) string
- func SubstitutionGetList(data []byte) (list []string, rest []string, ok bool)
- func SubstitutionMatchModelByPattern(model string, pattern string, hintOccurrence int, hintStrict bool) (params map[string]string, doubt bool, ok bool)
- func SubstitutionsGetNextPosition(list []string, rest []string, positions []int, model string) bool
- func SubstitutionsGetNextPositionFromLast(list []string, rest []string, positions []int, model string) bool
- func SubstitutionsGetParamsByPositions(list []string, rest []string, positions []int, model string) map[string]string
- func TryReadInteger(str string, def int) int
- func UpdateModelByListRestParams(pattern string, list []string, rest []string, paramMap map[string]string, ...) (string, error)
- func UpdateModelByParamGetter(pattern string, paramGetter func(string) (string, bool)) (string, []string)
- func UpdateModelByParams(pattern string, paramMap map[string]string) (string, error)
- func UpdateModelByParamsSilent(pattern string, paramMap map[string]string) (string, error)
- type ConfigInfo
- type InitBySettingFunc
Constants ¶
const ( CONFIG_RESULT_NOT_CONTAINING_PREMAP = 1 << iota CONFIG_REPLACEMENT_NOT_MANDATORY = 1 << iota CONFIG_IS_NOT_ESCAPED = 1 << iota CONFIG_IS_NOT_VARIABLES = 1 << iota CONFIG_DISABLE_INITIAL_MAP_FROM_ENVIRONMENT = 1 << iota CONFIG_PRESERVE_SPACE = 1 << iota )
const ( IFELSE_ELSE_NOTRUN = 0 IFELSE_ELSE_RUN = 1 IFELSE_ELSE_NOMORE = 2 IFELSE_ELSE_ERROR = 3 IFELSE_LOW_MASK = 7 IFELSE_CONSUMED = 16 IFELSE_NONEWIF = 8 )
Variables ¶
var DvParserLog bool = false
var GeneralFilePaths []string
var GeneralMicroCoreFolderIndex int = -1
var GeneralNamespaceFolderIndex int = -1
var GlobalProperties map[string]string
var GlobalPropertiesAsDvObject *dvevaluation.DvObject
var MicroCorePathSuffix = "PATH"
var MicroCorePrexix = "MICROCORE_"
var MicroCorePropertiesInCurrentFolderFileName = "MicroCore.properties"
MicroCorePropertiesInCurrentFolderFileName is a main property file name, which can be customized
var NumberOfBracketsInConfigParsing = 3
var SubstitutionEndParameter = []byte{'}'}
var SubstitutionStartParameter = []byte{'$', '{'}
Functions ¶
func AddNonRepeatingWords ¶
func ByteArrayEvaluatorAsInterface ¶
func ByteArrayEvaluatorAsInterface(data []byte, extraParams *dvevaluation.DvObject, source string) (interface{}, error)
func CallInitBySettingFunc ¶
func CallInitBySettingFuncDefault ¶
func CallInitBySettingFuncDefault()
func CleanLogByteArray ¶
func CleanLogString ¶
func CloneGlobalProperties ¶
func ConvertToList ¶
func ConvertToNonEmptyList ¶
func ConvertURLToList ¶
func EvaluateDifferenceRate ¶
func FindInGeneralPaths ¶
func GetCanonicalVersion ¶
func GetCommandLine ¶
func GetCommandLine() []string
func GetGlobalPropertiesAsDvObject ¶
func GetGlobalPropertiesAsDvObject() *dvevaluation.DvObject
func GetNextWordBySpaceTable ¶
func GetNextWordInText ¶
func GetProptertiesPrototypedToGlobalProperties ¶
func GetProptertiesPrototypedToGlobalProperties(localMap map[string]interface{}) *dvevaluation.DvObject
func GetUnquotedString ¶
func GetVersionIndex ¶
func InitAndReadCommandLine ¶
func InitAndReadCommandLine() []string
func InsertTextIntoBuffer ¶
func Int64ToFullHex ¶
func IsAlphabeticalLowCase ¶
func IsDigitOnly ¶
func JoinStringsWithClean ¶
func LinearSmartConfigFromFile ¶
func LinearSmartConfigFromFile(fileName string, configInfo *ConfigInfo, level int)
************************************************************************* level = -1 if even missing the file is not a problem
>= 0 start looking the file from paths configInfo.FilePaths[level] and up
**************************************************************************
func LinearSmartConfigParse ¶
func LinearSmartConfigParse(data []byte, configInfo *ConfigInfo, sourceName string)
func LoadSimpleMapFromFile ¶
func LogVariables ¶
func LookInDescriptionFile ¶
func MakeUniqueStringList ¶
func PresentMapAsProperties ¶
func PrintInt64ToByteBuffer ¶
func QuickLookJsonOption ¶
func ReadHexValue ¶
func ReadPropertiesOrPanic ¶
func RegisterInitBySettingFunc ¶
func RegisterInitBySettingFunc(initializer InitBySettingFunc) bool
func RemoveGlobalPropertiesValue ¶
func RemoveGlobalPropertiesValue(key string)
func SeparateToKeyValue ¶
func SetMicroCorePrefix ¶
func SetMicroCorePrefix(prefix string)
func SetNumberOfBracketsInConfigParsing ¶
func SetNumberOfBracketsInConfigParsing(n int)
func SetPrefixesByApplicationName ¶
func SetPrefixesByApplicationName(name string)
SetPrefixesByApplicationName must be called at start of the application to customize prefixes and property file names
func SmartReadFileAsString ¶
func SmartReadTemplate ¶
func SmartReadTemplateLines ¶
func StringEvaluatorAsBoolean ¶
func StringEvaluatorAsBoolean(data string, extraParams *dvevaluation.DvObject) (bool, error)
func StringEvaluatorAsBooleanWithErrorLoggedAsWarning ¶
func StringEvaluatorAsBooleanWithErrorLoggedAsWarning(data string, extraParams *dvevaluation.DvObject, defaultIfError bool) bool
func StringEvaluatorAsString ¶
func StringEvaluatorAsString(data string, extraParams *dvevaluation.DvObject) (string, error)
func StringEvaluatorAsStringWithErrorLoggedAsWarning ¶
func StringEvaluatorAsStringWithErrorLoggedAsWarning(data string, extraParams *dvevaluation.DvObject, defaultIfError string) string