Documentation
¶
Overview ¶
********************************************************************** MicroCore Copyright 2020-2021 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 2020 - 2021 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
Index ¶
- Constants
- Variables
- 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 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 CopyInterfaceMapToStringMap(src map[string]interface{}, dst map[string]string)
- 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 GetCommandLine() []string
- func GetGlobalPropertiesAsDvObject() *dvevaluation.DvObject
- func GetPropertiesPrototypedToGlobalProperties(localMap map[string]interface{}) *dvevaluation.DvObject
- func InitAndReadCommandLine() []string
- func IsDevelopment() 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 LogVariables(name string, vars map[string]string)
- func ReadGlobalPropertiesAny(key string) (interface{}, bool)
- 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 RegisterInitBySettingFunc(initializer InitBySettingFunc) bool
- func RemoveGlobalPropertiesValue(key string)
- func ReplaceTextInsideByteArray(data []byte, start int, end int, replacement []byte) []byte
- func SetGlobalPropertiesAnyValue(key string, value interface{})
- func SetGlobalPropertiesValue(key string, value string)
- func SetMicroCorePrefix(prefix string)
- func SetNumberOfBracketsInConfigParsing(n int)
- func SetPrefixesByApplicationName(name string)
- func SmartReadFileAsString(fileName string) (string, error)
- func SmartReadLikeJsonTemplate(filename string, numberOfBrackets int, params *dvevaluation.DvObject) ([]byte, error)
- func SmartReadTemplate(filename string, numberOfBrackets int, joiner byte) ([]byte, error)
- func SmartReadTemplateLines(fileName string, numberOfBrackets int, properties *dvevaluation.DvObject) (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
- 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 IsDevelopmentVar = "IS_DEVELOPMENT"
var MicroCorePathSuffix = "PATH"
var MicroCorePrexix = "MICROCORE_"
var MicroCorePropertiesInCurrentFolderFileName = "MicroCore.properties"
MicroCorePropertiesInCurrentFolderFileName is a main property file name, which can be customized
var NumberOfBracketsInConfigParsing = 3
Functions ¶
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 CopyInterfaceMapToStringMap ¶ added in v1.0.2
func FindInGeneralPaths ¶
func GetCommandLine ¶
func GetCommandLine() []string
func GetGlobalPropertiesAsDvObject ¶
func GetGlobalPropertiesAsDvObject() *dvevaluation.DvObject
func GetPropertiesPrototypedToGlobalProperties ¶ added in v1.0.2
func GetPropertiesPrototypedToGlobalProperties(localMap map[string]interface{}) *dvevaluation.DvObject
func InitAndReadCommandLine ¶
func InitAndReadCommandLine() []string
func IsDevelopment ¶ added in v1.0.2
func IsDevelopment() bool
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 LogVariables ¶
func ReadGlobalPropertiesAny ¶ added in v1.0.2
func ReadPropertiesOrPanic ¶
func RegisterInitBySettingFunc ¶
func RegisterInitBySettingFunc(initializer InitBySettingFunc) bool
func RemoveGlobalPropertiesValue ¶
func RemoveGlobalPropertiesValue(key string)
func SetGlobalPropertiesAnyValue ¶ added in v1.0.2
func SetGlobalPropertiesAnyValue(key string, value interface{})
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 SmartReadLikeJsonTemplate ¶ added in v1.0.2
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