Documentation ¶
Overview ¶
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2022 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2023 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
*********************************** The Version function assumes the original version to be stored as either an object with multiple versions, for example:
{ "module1": "0.0.0.1", "module2": "1.2.3", "module3": "20", }
or a single string (for example: "20.0") Versions in the same format must be stored in 2 places: source and destination. It executes actions only if any of those versions in the source are higher than in the destination. In case of a single string: I. A specified subroutine ("mainUpdate")is executed, which receives as a parameter the highest version ||. A specified subroutine ("versionUpdate") is executed to store the version in the destination (it is stored in VERSION_VALUE variable") In case of multiple versions, the execution depends on the mode as follows: "mode": = "simple" or "combined" In case of "simple", "mainUpdate" is executed for each key where version is higher Parameters are "VERSION_VALUE", "VERSION_KEY" The final version of the object is stored by special action ("versionUpdate") In case of combined, a filter is created for multiple versions to contain only those keys where the version is higher It is executed only once with this object of key:version as a parameter ("mainUpdate") For both modes, the saving of the versions in the destinations is saved as combined
Index ¶
- Constants
- Variables
- func ActCalculation(env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, wholeAssign string) int
- func ActionContextResult(ctx *dvcontext.RequestContext)
- func ActionExceptionByError(comment string, err error, ctx *dvcontext.RequestContext)
- func ActionExternalException(status int, body []byte, ctx *dvcontext.RequestContext)
- func ActionFinalException(status int, body []byte, ctx *dvcontext.RequestContext)
- func ActionInternalException(status int, shortMessage string, longMessage string, ...)
- func ActionProcessResult(ctx *dvcontext.RequestContext, res bool)
- func AddProcessFunction(key string, processor ProcessFunction)
- func AddProcessFunctions(pf map[string]ProcessFunction)
- func AssignVariables(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ...)
- func CleanM2MTokenInCache(microserviceName string)
- func CompareJsonByConfig(config *CompareJsonConfig, ctx *dvcontext.RequestContext) bool
- func DebugShowVariable(ctx *dvcontext.RequestContext, name string)
- func DebugShowVariablesByEnvList(ctx *dvcontext.RequestContext, lstName string)
- func DebugShowVariablesByList(ctx *dvcontext.RequestContext, lst string)
- func DefaultInitWithObject(command string, result interface{}, env *dvevaluation.DvObject) bool
- func DefaultOrSimpleInitWithObject(command string, result interface{}, env *dvevaluation.DvObject) (bool, string)
- func DeleteActionResult(result string, ctx *dvcontext.RequestContext)
- func ExecCall(config *ExecCallConfig, ctx *dvcontext.RequestContext) bool
- func ExecFor(config *ExecForConfig, ctx *dvcontext.RequestContext) bool
- func ExecIf(config *ExecIfConfig, ctx *dvcontext.RequestContext) bool
- func ExecIfArray(config *ExecIfArrayConfig, ctx *dvcontext.RequestContext) bool
- func ExecIfEmpty(config *ExecIfEmptyConfig, ctx *dvcontext.RequestContext) bool
- func ExecRange(config *ExecRangeConfig, ctx *dvcontext.RequestContext) bool
- func ExecReturn(config *ExecReturnConfig, ctx *dvcontext.RequestContext) bool
- func ExecReturnShort(result string, ctx *dvcontext.RequestContext) bool
- func ExecSwitch(config *ExecSwitchConfig, ctx *dvcontext.RequestContext) bool
- func ExecuteAddSubsequence(ctx *dvcontext.RequestContext, actionName string, paramStr map[string]string, ...)
- func ExecuteAddSubsequenceShort(ctx *dvcontext.RequestContext, actionName string)
- func ExecuteCalculate(ctx *dvcontext.RequestContext, data map[string]string)
- func ExecuteProcessFunction(fn *ProcessFunction, pauseTime int, totalTime int, command string, ...) bool
- func ExecuteReturnSubsequence(ctx *dvcontext.RequestContext, retValue string)
- func ExecuteSequence(startActionName string, ctx *dvcontext.RequestContext, ...) bool
- func ExecuteSequenceCycle(ctx *dvcontext.RequestContext, cycleLevel int) bool
- func ExecuteSingleCommand(pauseTime int, totalTime int, prefix string, command string) bool
- func FilterOutByConditionSetUnset(env *dvevaluation.DvObject, src *dvevaluation.DvVariable, ...)
- func FindChangeByConfig(config *FindChangeConfig, ctx *dvcontext.RequestContext) bool
- func GetContextFileResult(ctx *dvcontext.RequestContext, fileName string) ([]byte, error)
- func GetContextVarResult(ctx *dvcontext.RequestContext, varName string) ([]byte, error)
- func GetEnvironment(ctx *dvcontext.RequestContext) *dvevaluation.DvObject
- func GetIdentityProviderClientCredentials(microServiceName string) (user string, pw string, ok bool)
- func GetM2MToken(microserviceName string) (token string, okFinal bool)
- func GetM2MTokenFromFileSystem(microserviceName string) (token string, ok bool)
- func GetMicroServicePropertyName(microServiceName string) string
- func IsLikeJson(s string) bool
- func JsRunByConfig(config *JsConfig, ctx *dvcontext.RequestContext) bool
- func JsonConvertConcat(push *JsonRead, dst *dvevaluation.DvVariable, ctx *dvcontext.RequestContext)
- func JsonConvertPush(push *JsonRead, dst *dvevaluation.DvVariable, ctx *dvcontext.RequestContext)
- func JsonConvertRunByConfig(config *JsonConvertConfig, ctx *dvcontext.RequestContext) bool
- func JsonExtract(info *JsonRead, ctx *dvcontext.RequestContext) (interface{}, error)
- func JsonExtractExtended(place string, path string, filter string, sort []string, afterPath string, ...) (interface{}, error)
- func NetRequest(method string, url string, body string, headers map[string]string, ...) ([]byte, error, http.Header, int)
- func PagingRunByConfig(config *PagingConfig, ctx *dvcontext.RequestContext) bool
- func ProcessSavingActionResult(result string, data interface{}, ctx *dvcontext.RequestContext, err error, ...) bool
- func ProcessSingleFile(fileName string, config *ReadFileConfig, ctx *dvcontext.RequestContext, ...) bool
- func ProxyNetInit(command string, ctx *dvcontext.RequestContext) ([]interface{}, bool)
- func ProxyNetRun(data []interface{}) bool
- func ProxyNetRunByConfig(config *ProxyNetConfig, ctx *dvcontext.RequestContext) bool
- func ReadActionResult(result string, ctx *dvcontext.RequestContext) (res interface{}, ok bool)
- func ReadFileByConfigKind(config *ReadFileConfig, ctx *dvcontext.RequestContext) bool
- func ReadJsonTrimmed(data []byte, path string, noReadOfUndefined bool, env *dvevaluation.DvObject) (interface{}, error)
- func RegisterCredentialProvider(provider CredentialProvider)
- func RegisterOC() bool
- func RegisterStorageActionProvider(name string, provider StorageActionProvider)
- func SaveActionResult(result string, data interface{}, ctx *dvcontext.RequestContext)
- func SaveHeaderResult(result string, heads http.Header, env *dvevaluation.DvObject)
- func SaveM2MTokenInFileSystem(microserviceName string, accessToken *AccessToken)
- func SetReturnParameters(params map[string]string, ctx *dvcontext.RequestContext)
- func SmartNetInit(command string, ctx *dvcontext.RequestContext) ([]interface{}, bool)
- func SmartNetRun(data []interface{}) bool
- func SmartNetRunByConfig(config *SmartNetConfig, ctx *dvcontext.RequestContext) bool
- func SseExecutor(ctx *dvcontext.RequestContext, v interface{}) interface{}
- func SseServe(ctx *dvcontext.RequestContext, control *dvcontext.Stage) bool
- func StoreRunByConfig(config *StoreConfig, ctx *dvcontext.RequestContext) bool
- func StoreValue(path string, data interface{}, format string, before string, after string, ...) (err error)
- func UpsertJsonByConfig(config *UpsertJsonConfig, ctx *dvcontext.RequestContext) bool
- func ValidateCondition(data string, env *dvevaluation.DvObject) (bool, bool)
- func ValidateExists(data string, env *dvevaluation.DvObject) bool
- func ValidateItem(item *ValidationItem, env *dvevaluation.DvObject) (int, string, bool)
- func ValidateNonEmpty(data string, env *dvevaluation.DvObject) bool
- func ValidationRunByConfig(config *ValidationConfig, ctx *dvcontext.RequestContext) bool
- func VarTransformRunByConfig(config *VarTransformConfig, ctx *dvcontext.RequestContext) bool
- func VersionKeyValueExecution(src map[string]string, dst map[string]string, config *VersionConfig, ...)
- func VersionRunByConfig(config *VersionConfig, ctx *dvcontext.RequestContext) bool
- func VersionStringExecution(src string, dst string, config *VersionConfig, ctx *dvcontext.RequestContext)
- type AccessToken
- type AssignInfo
- type AssignmentBlock
- type Collection
- type CompareJsonConfig
- type ConcatObjectInfo
- type ConditionBlock
- func (b *ConditionBlock) EvaluateSuccess(env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, fields []string) bool
- func (b *ConditionBlock) Process(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ...) int
- func (b *ConditionBlock) ProcessSingle(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ...) int
- type ConvertReplaceBlock
- type CredentialProvider
- type ErrorActionProvider
- func (provider *ErrorActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *ErrorActionProvider) PathSupported() bool
- func (provider *ErrorActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *ErrorActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type ExecCallConfig
- type ExecForConfig
- type ExecIfArrayConfig
- type ExecIfConfig
- type ExecIfEmptyConfig
- type ExecRangeConfig
- type ExecReturnConfig
- type ExecSwitchConfig
- type FileActionProvider
- func (provider *FileActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *FileActionProvider) PathSupported() bool
- func (provider *FileActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *FileActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type FileSizeActionProvider
- func (provider *FileSizeActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *FileSizeActionProvider) PathSupported() bool
- func (provider *FileSizeActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *FileSizeActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type FilterOutBlock
- type FindChangeConfig
- type ForEachBlock
- func (proc *ForEachBlock) ForEachProcessing(src *dvevaluation.DvVariable, env *dvevaluation.DvObject, ...)
- func (proc *ForEachBlock) ForEachProcessingWithPath(forEachPathKeys *dvevaluation.DvVariable, ...)
- func (proc *ForEachBlock) ForEachProcessingWithoutPath(src *dvevaluation.DvVariable, env *dvevaluation.DvObject, ...)
- type GlobalActionProvider
- func (provider *GlobalActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *GlobalActionProvider) PathSupported() bool
- func (provider *GlobalActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *GlobalActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type IncreaseVersionInfo
- type JsConfig
- type JsonConvertConfig
- type JsonParseData
- type JsonRead
- type LogActionProvider
- func (provider *LogActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *LogActionProvider) PathSupported() bool
- func (provider *LogActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *LogActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type MapActionProvider
- func (provider *MapActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *MapActionProvider) PathSupported() bool
- func (provider *MapActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *MapActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type ObjectByArrayInfo
- type ObjectByObjectInfo
- type PagingConfig
- type PlaceRegExpression
- type ProcessFunction
- type ProxyNetConfig
- type ReadFileConfig
- type RemoveByKeysInfo
- type ReplaceRegExpression
- type ReplaceTextInfo
- type RequestActionProvider
- func (provider *RequestActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *RequestActionProvider) PathSupported() bool
- func (provider *RequestActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *RequestActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type SessionActionProvider
- func (provider *SessionActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
- func (provider *SessionActionProvider) PathSupported() bool
- func (provider *SessionActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
- func (provider *SessionActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
- type SmartNetConfig
- type SmartNetConfigTemplate
- type StorageActionProvider
- type StoreConfig
- type UpsertJsonConfig
- type ValidationConfig
- type ValidationItem
- type VarTransformConfig
- type VersionConfig
Constants ¶
const ( CommandCall = "call" CommandCompareJson = "compare" CommandConvert = "convert" CommandFile = "file" CommandFor = "for" CommandHttp = "http" CommandIf = "if" CommandIfArray = "ifarray" CommandIfEmpty = "ifempty" CommandJs = "js" CommandNet = "net" CommandOs = "os" CommandPaging = "paging" CommandPortForward = "forward" CommandProxy = "proxy" CommandRange = "range" CommandRecordBind = "recordbind" CommandRecordCreate = "recordcreate" CommandRecordDelete = "recorddelete" CommandRecordReadAll = "recordreadall" CommandRecordReadOne = "recordreadone" CommandRecordScan = "recordscan" CommandRecordUpdate = "recordupdate" CommandReturn = "return" CommandStore = "store" CommandSql = "sql" CommandSwitch = "switch" CommandUpsert = "upsert" CommandValidate = "validate" CommandVar = "var" CommandVersion = "version" CommandVoid = "void" )
const ( ExSeqPrefix = "EXSEQ_" ExSeqIP = "IP" ExSeqActionName = "ACTION_NAME" ExSeqLevel = ExSeqPrefix + "LEVEL" ExSeqSuffix = "_" ExSeqReturn = "ACTION_RETURN" ExSeqIgnoreReturn = "_" ExSeqCurrentLevel = ExSeqPrefix + "CURRENT_LEVEL" ExSeqReturnAllDefaultNames = "" ExSeqReturnSingleDefault = "RETURN" ExActionLog = "__ACTION_LOG__" )
const ( ACT_NORMAL = iota ACT_BREAK ACT_REMOVE ACT_REPLACE ACT_REPLACE_BREAK )
const ( M2MTokenPrefix = "M2M_TOKEN_" M2MTokenPath = "M2MTOKEN_PATH" M2M = "M2M" M2M_USERNAME = "M2M_USERNAME" M2M_PASSWORD = "M2M_PASSWORD" M2M_ = "M2M_" )
const (
ActionPrefix = "ACTION_"
)
const (
Authorization = "Authorization"
)
Variables ¶
var ActionLog bool = false
var Log = dvlog.LogError
var StorageProviders map[string]StorageActionProvider = make(map[string]StorageActionProvider, 32)
Functions ¶
func ActCalculation ¶
func ActCalculation(env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, wholeAssign string) int
func ActionContextResult ¶
func ActionContextResult(ctx *dvcontext.RequestContext)
func ActionExceptionByError ¶
func ActionExceptionByError(comment string, err error, ctx *dvcontext.RequestContext)
func ActionExternalException ¶
func ActionExternalException(status int, body []byte, ctx *dvcontext.RequestContext)
func ActionFinalException ¶
func ActionFinalException(status int, body []byte, ctx *dvcontext.RequestContext)
func ActionInternalException ¶
func ActionInternalException(status int, shortMessage string, longMessage string, ctx *dvcontext.RequestContext)
func ActionProcessResult ¶
func ActionProcessResult(ctx *dvcontext.RequestContext, res bool)
func AddProcessFunction ¶
func AddProcessFunction(key string, processor ProcessFunction)
func AddProcessFunctions ¶
func AddProcessFunctions(pf map[string]ProcessFunction)
func AssignVariables ¶
func AssignVariables(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, assigns []*AssignmentBlock)
func CleanM2MTokenInCache ¶
func CleanM2MTokenInCache(microserviceName string)
func CompareJsonByConfig ¶
func CompareJsonByConfig(config *CompareJsonConfig, ctx *dvcontext.RequestContext) bool
func DebugShowVariable ¶
func DebugShowVariable(ctx *dvcontext.RequestContext, name string)
func DebugShowVariablesByEnvList ¶
func DebugShowVariablesByEnvList(ctx *dvcontext.RequestContext, lstName string)
func DebugShowVariablesByList ¶
func DebugShowVariablesByList(ctx *dvcontext.RequestContext, lst string)
func DefaultInitWithObject ¶
func DefaultInitWithObject(command string, result interface{}, env *dvevaluation.DvObject) bool
func DefaultOrSimpleInitWithObject ¶
func DefaultOrSimpleInitWithObject(command string, result interface{}, env *dvevaluation.DvObject) (bool, string)
func DeleteActionResult ¶
func DeleteActionResult(result string, ctx *dvcontext.RequestContext)
func ExecCall ¶
func ExecCall(config *ExecCallConfig, ctx *dvcontext.RequestContext) bool
func ExecFor ¶
func ExecFor(config *ExecForConfig, ctx *dvcontext.RequestContext) bool
func ExecIf ¶
func ExecIf(config *ExecIfConfig, ctx *dvcontext.RequestContext) bool
func ExecIfArray ¶
func ExecIfArray(config *ExecIfArrayConfig, ctx *dvcontext.RequestContext) bool
func ExecIfEmpty ¶
func ExecIfEmpty(config *ExecIfEmptyConfig, ctx *dvcontext.RequestContext) bool
func ExecRange ¶
func ExecRange(config *ExecRangeConfig, ctx *dvcontext.RequestContext) bool
func ExecReturn ¶
func ExecReturn(config *ExecReturnConfig, ctx *dvcontext.RequestContext) bool
func ExecReturnShort ¶
func ExecReturnShort(result string, ctx *dvcontext.RequestContext) bool
func ExecSwitch ¶
func ExecSwitch(config *ExecSwitchConfig, ctx *dvcontext.RequestContext) bool
func ExecuteAddSubsequence ¶
func ExecuteAddSubsequenceShort ¶
func ExecuteAddSubsequenceShort(ctx *dvcontext.RequestContext, actionName string)
func ExecuteCalculate ¶
func ExecuteCalculate(ctx *dvcontext.RequestContext, data map[string]string)
func ExecuteProcessFunction ¶
func ExecuteProcessFunction(fn *ProcessFunction, pauseTime int, totalTime int, command string, group *sync.WaitGroup, ctx *dvcontext.RequestContext, debugList string) bool
func ExecuteReturnSubsequence ¶
func ExecuteReturnSubsequence(ctx *dvcontext.RequestContext, retValue string)
func ExecuteSequence ¶
func ExecuteSequenceCycle ¶
func ExecuteSequenceCycle(ctx *dvcontext.RequestContext, cycleLevel int) bool
func ExecuteSingleCommand ¶
func FilterOutByConditionSetUnset ¶
func FilterOutByConditionSetUnset(env *dvevaluation.DvObject, src *dvevaluation.DvVariable, filter *FilterOutBlock)
func FindChangeByConfig ¶
func FindChangeByConfig(config *FindChangeConfig, ctx *dvcontext.RequestContext) bool
func GetContextFileResult ¶
func GetContextFileResult(ctx *dvcontext.RequestContext, fileName string) ([]byte, error)
func GetContextVarResult ¶
func GetContextVarResult(ctx *dvcontext.RequestContext, varName string) ([]byte, error)
func GetEnvironment ¶
func GetEnvironment(ctx *dvcontext.RequestContext) *dvevaluation.DvObject
func GetM2MToken ¶
func IsLikeJson ¶
func JsRunByConfig ¶
func JsRunByConfig(config *JsConfig, ctx *dvcontext.RequestContext) bool
func JsonConvertConcat ¶
func JsonConvertConcat(push *JsonRead, dst *dvevaluation.DvVariable, ctx *dvcontext.RequestContext)
func JsonConvertPush ¶
func JsonConvertPush(push *JsonRead, dst *dvevaluation.DvVariable, ctx *dvcontext.RequestContext)
func JsonConvertRunByConfig ¶
func JsonConvertRunByConfig(config *JsonConvertConfig, ctx *dvcontext.RequestContext) bool
func JsonExtract ¶
func JsonExtract(info *JsonRead, ctx *dvcontext.RequestContext) (interface{}, error)
func JsonExtractExtended ¶
func NetRequest ¶
func PagingRunByConfig ¶
func PagingRunByConfig(config *PagingConfig, ctx *dvcontext.RequestContext) bool
func ProcessSingleFile ¶
func ProcessSingleFile(fileName string, config *ReadFileConfig, ctx *dvcontext.RequestContext, isMulti bool) bool
func ProxyNetInit ¶
func ProxyNetInit(command string, ctx *dvcontext.RequestContext) ([]interface{}, bool)
func ProxyNetRun ¶
func ProxyNetRun(data []interface{}) bool
func ProxyNetRunByConfig ¶
func ProxyNetRunByConfig(config *ProxyNetConfig, ctx *dvcontext.RequestContext) bool
func ReadActionResult ¶
func ReadActionResult(result string, ctx *dvcontext.RequestContext) (res interface{}, ok bool)
func ReadFileByConfigKind ¶
func ReadFileByConfigKind(config *ReadFileConfig, ctx *dvcontext.RequestContext) bool
func ReadJsonTrimmed ¶
func RegisterCredentialProvider ¶
func RegisterCredentialProvider(provider CredentialProvider)
func RegisterOC ¶
func RegisterOC() bool
func RegisterStorageActionProvider ¶
func RegisterStorageActionProvider(name string, provider StorageActionProvider)
func SaveActionResult ¶
func SaveActionResult(result string, data interface{}, ctx *dvcontext.RequestContext)
func SaveHeaderResult ¶
func SaveHeaderResult(result string, heads http.Header, env *dvevaluation.DvObject)
func SaveM2MTokenInFileSystem ¶
func SaveM2MTokenInFileSystem(microserviceName string, accessToken *AccessToken)
func SetReturnParameters ¶
func SetReturnParameters(params map[string]string, ctx *dvcontext.RequestContext)
func SmartNetInit ¶
func SmartNetInit(command string, ctx *dvcontext.RequestContext) ([]interface{}, bool)
func SmartNetRun ¶
func SmartNetRun(data []interface{}) bool
func SmartNetRunByConfig ¶
func SmartNetRunByConfig(config *SmartNetConfig, ctx *dvcontext.RequestContext) bool
func SseExecutor ¶
func SseExecutor(ctx *dvcontext.RequestContext, v interface{}) interface{}
func StoreRunByConfig ¶
func StoreRunByConfig(config *StoreConfig, ctx *dvcontext.RequestContext) bool
func StoreValue ¶
func UpsertJsonByConfig ¶
func UpsertJsonByConfig(config *UpsertJsonConfig, ctx *dvcontext.RequestContext) bool
func ValidateCondition ¶
func ValidateCondition(data string, env *dvevaluation.DvObject) (bool, bool)
func ValidateExists ¶
func ValidateExists(data string, env *dvevaluation.DvObject) bool
func ValidateItem ¶
func ValidateItem(item *ValidationItem, env *dvevaluation.DvObject) (int, string, bool)
func ValidateNonEmpty ¶
func ValidateNonEmpty(data string, env *dvevaluation.DvObject) bool
func ValidationRunByConfig ¶
func ValidationRunByConfig(config *ValidationConfig, ctx *dvcontext.RequestContext) bool
func VarTransformRunByConfig ¶
func VarTransformRunByConfig(config *VarTransformConfig, ctx *dvcontext.RequestContext) bool
func VersionKeyValueExecution ¶
func VersionKeyValueExecution(src map[string]string, dst map[string]string, config *VersionConfig, ctx *dvcontext.RequestContext)
func VersionRunByConfig ¶
func VersionRunByConfig(config *VersionConfig, ctx *dvcontext.RequestContext) bool
func VersionStringExecution ¶
func VersionStringExecution(src string, dst string, config *VersionConfig, ctx *dvcontext.RequestContext)
Types ¶
type AccessToken ¶
type AccessToken struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` RefreshExpiresIn int `json:"refresh_expires_in"` RefreshToken string `json:"refresh_token"` NotBeforePolicy int `json:"not-before-policy"` SessionState string `json:"session_state"` Scope string `json:"scope"` }
type AssignInfo ¶
type AssignmentBlock ¶
type Collection ¶
type Collection struct { Source string `json:"source"` Unique []string `json:"unique"` Assign []*AssignmentBlock `json:"assign"` MergeMode int `json:"merge_mode"` Append bool `json:"append"` }
func (*Collection) AddItem ¶
func (collection *Collection) AddItem(env *dvevaluation.DvObject)
func (*Collection) AddItemSecondary ¶
func (collection *Collection) AddItemSecondary(env *dvevaluation.DvObject)
func (*Collection) Initialize ¶
func (collection *Collection) Initialize(env *dvevaluation.DvObject)
type CompareJsonConfig ¶
type CompareJsonConfig struct { Sample *JsonRead `json:"sample"` Ref *JsonRead `json:"ref"` Added string `json:"added"` Removed string `json:"removed"` Updated string `json:"updated"` UpdatedRef string `json:"updatedRef"` Unchanged string `json:"unchanged"` UnchangedAsUpdated bool `json:"unchangedAsUpdated"` }
type ConcatObjectInfo ¶
type ConditionBlock ¶
type ConditionBlock struct { Condition string `json:"condition"` SetList []string `json:"set"` UnsetList []string `json:"unset"` ThenAssign []*AssignmentBlock `json:"then_assign"` ElseAssign []*AssignmentBlock `json:"else_assign"` ThenWholeAssign string `json:"then_to_whole"` ElseWholeAssign string `json:"else_to_whole"` ThenCollection *Collection `json:"then_collection"` ElseCollection *Collection `json:"else_collection"` Match string `json:"match"` Item string `json:"item"` // contains filtered or unexported fields }
func (*ConditionBlock) EvaluateSuccess ¶
func (b *ConditionBlock) EvaluateSuccess(env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, fields []string) bool
func (*ConditionBlock) Process ¶
func (b *ConditionBlock) Process(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, fields []string) int
func (*ConditionBlock) ProcessSingle ¶
func (b *ConditionBlock) ProcessSingle(f *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext, fields []string) int
type ConvertReplaceBlock ¶
type ErrorActionProvider ¶
type ErrorActionProvider struct{}
func (*ErrorActionProvider) Delete ¶
func (provider *ErrorActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*ErrorActionProvider) PathSupported ¶
func (provider *ErrorActionProvider) PathSupported() bool
func (*ErrorActionProvider) Read ¶
func (provider *ErrorActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*ErrorActionProvider) Save ¶
func (provider *ErrorActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type ExecCallConfig ¶
type ExecForConfig ¶
type ExecIfArrayConfig ¶
type ExecIfArrayConfig struct { Source string `json:"source"` Then *ExecCallConfig `json:"then"` Else *ExecCallConfig `json:"else"` Ensure string `json:"ensure"` }
type ExecIfConfig ¶
type ExecIfConfig struct { Condition string `json:"condition"` Then *ExecCallConfig `json:"then"` Else *ExecCallConfig `json:"else"` OnError *ExecCallConfig `json:"on_error"` Error int `json:"error"` }
type ExecIfEmptyConfig ¶
type ExecIfEmptyConfig struct { Source string `json:"source"` Then *ExecCallConfig `json:"then"` Else *ExecCallConfig `json:"else"` }
type ExecRangeConfig ¶
type ExecReturnConfig ¶
type ExecReturnConfig struct {
Result string `json:"result"`
}
type ExecSwitchConfig ¶
type FileActionProvider ¶
type FileActionProvider struct{}
func (*FileActionProvider) Delete ¶
func (provider *FileActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*FileActionProvider) PathSupported ¶
func (provider *FileActionProvider) PathSupported() bool
func (*FileActionProvider) Read ¶
func (provider *FileActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*FileActionProvider) Save ¶
func (provider *FileActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type FileSizeActionProvider ¶
type FileSizeActionProvider struct{}
func (*FileSizeActionProvider) Delete ¶
func (provider *FileSizeActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*FileSizeActionProvider) PathSupported ¶
func (provider *FileSizeActionProvider) PathSupported() bool
func (*FileSizeActionProvider) Read ¶
func (provider *FileSizeActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*FileSizeActionProvider) Save ¶
func (provider *FileSizeActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type FilterOutBlock ¶
type FindChangeConfig ¶
type ForEachBlock ¶
type ForEachBlock struct { PreCondition string `json:"pre_condition"` WildCardPath string `json:"path"` Blocks []*ConditionBlock `json:"blocks"` }
func (*ForEachBlock) ForEachProcessing ¶
func (proc *ForEachBlock) ForEachProcessing(src *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext)
func (*ForEachBlock) ForEachProcessingWithPath ¶
func (proc *ForEachBlock) ForEachProcessingWithPath(forEachPathKeys *dvevaluation.DvVariable, forEachPathValues *dvevaluation.DvVariable, pathes []string, src *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext)
func (*ForEachBlock) ForEachProcessingWithoutPath ¶
func (proc *ForEachBlock) ForEachProcessingWithoutPath(src *dvevaluation.DvVariable, env *dvevaluation.DvObject, ctx *dvcontext.RequestContext)
type GlobalActionProvider ¶
type GlobalActionProvider struct{}
func (*GlobalActionProvider) Delete ¶
func (provider *GlobalActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*GlobalActionProvider) PathSupported ¶
func (provider *GlobalActionProvider) PathSupported() bool
********************************************************************************************************
func (*GlobalActionProvider) Read ¶
func (provider *GlobalActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*GlobalActionProvider) Save ¶
func (provider *GlobalActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type IncreaseVersionInfo ¶
type JsonConvertConfig ¶
type JsonConvertConfig struct { Source *JsonRead `json:"source"` Result string `json:"result"` Add []*JsonRead `json:"add"` Merge []*JsonRead `json:"merge"` Replace []*JsonRead `json:"replace"` Update []*JsonRead `json:"update"` Push []*JsonRead `json:"push"` Concat []*JsonRead `json:"concat"` Remove []string `json:"remove"` ForEach *ForEachBlock `json:"for_each"` Filter *FilterOutBlock `json:"filter"` ReplaceBlock *ConvertReplaceBlock `json:"replace_block"` }
type JsonParseData ¶
type JsonRead ¶
type JsonRead struct { Var string `json:"var"` Path string `json:"path"` Filter string `json:"filter"` Sort []string `json:"sort"` AfterPath string `json:"afterPath"` NoReadOfUndefined bool `json:"noReadOfUndefined"` ErrorSignificant bool `json:"errorSignificant"` Convert string `json:"convert"` Ids []string `json:"ids"` Destination string `json:"destination"` }
type LogActionProvider ¶
type LogActionProvider struct{}
func (*LogActionProvider) Delete ¶
func (provider *LogActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*LogActionProvider) PathSupported ¶
func (provider *LogActionProvider) PathSupported() bool
func (*LogActionProvider) Read ¶
func (provider *LogActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*LogActionProvider) Save ¶
func (provider *LogActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type MapActionProvider ¶
type MapActionProvider struct{}
func (*MapActionProvider) Delete ¶
func (provider *MapActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*MapActionProvider) PathSupported ¶
func (provider *MapActionProvider) PathSupported() bool
********************************************************************************************************
func (*MapActionProvider) Read ¶
func (provider *MapActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*MapActionProvider) Save ¶
func (provider *MapActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type ObjectByArrayInfo ¶
type ObjectByObjectInfo ¶
type PagingConfig ¶
type PlaceRegExpression ¶
type ProcessFunction ¶
type ProxyNetConfig ¶
type ProxyNetConfig struct { Url string `json:"url"` Method string `json:"method"` Headers string `json:"headers"` ContentType string `json:"type"` Result string `json:"result"` Body string `json:"body"` DefaultResult string `json:"default"` NotProxyHeaders bool `json:"not_proxy_headers"` NotProxyUrlParams bool `json:"not_proxy_url_params"` NotAddUrlPath bool `json:"not_add_url_path"` NotProxyBody bool `json:"not_proxy_body"` NotReturnHeaders bool `json:"not_return_headers"` Ignorable bool `json:"ignorable"` M2MSimple bool `json:"m2m_simple"` UrlFromParam string `json:"url_from_param"` }
type ReadFileConfig ¶
type ReadFileConfig struct { FileName string `json:"name"` Kind string `json:"kind"` Result string `json:"result"` Path string `json:"path"` Filter string `json:"filter"` Sort []string `json:"sort"` Joiner string `json:"joiner"` Append int `json:"append"` NoReadOfUndefined bool `json:"noReadOfUndefined"` ErrorSignificant bool `json:"errorSignificant"` IsTemplate bool `json:"template"` EolJoiner bool `json:"eol_joiner"` }
type RemoveByKeysInfo ¶
type ReplaceRegExpression ¶
type ReplaceTextInfo ¶
type RequestActionProvider ¶
type RequestActionProvider struct{}
func (*RequestActionProvider) Delete ¶
func (provider *RequestActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*RequestActionProvider) PathSupported ¶
func (provider *RequestActionProvider) PathSupported() bool
********************************************************************************************************
func (*RequestActionProvider) Read ¶
func (provider *RequestActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*RequestActionProvider) Save ¶
func (provider *RequestActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type SessionActionProvider ¶
type SessionActionProvider struct{}
func (*SessionActionProvider) Delete ¶
func (provider *SessionActionProvider) Delete(ctx *dvcontext.RequestContext, prefix string, key string) error
func (*SessionActionProvider) PathSupported ¶
func (provider *SessionActionProvider) PathSupported() bool
func (*SessionActionProvider) Read ¶
func (provider *SessionActionProvider) Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error)
func (*SessionActionProvider) Save ¶
func (provider *SessionActionProvider) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error
type SmartNetConfig ¶
type SmartNetConfig struct { Url string `json:"url"` Method string `json:"method"` Headers string `json:"headers"` Template SmartNetConfigTemplate `json:"template"` ContentType string `json:"type"` Result string `json:"result"` DefaultResult string `json:"default"` Body string `json:"body"` Ignorable bool `json:"ignorable"` M2MSimple bool `json:"m2m_simple"` }
type SmartNetConfigTemplate ¶
type StorageActionProvider ¶
type StorageActionProvider interface { PathSupported() bool Read(ctx *dvcontext.RequestContext, prefix string, key string) (interface{}, bool, error) Save(ctx *dvcontext.RequestContext, prefix string, key string, value interface{}) error Delete(ctx *dvcontext.RequestContext, prefix string, key string) error }
type StoreConfig ¶
type UpsertJsonConfig ¶
type ValidationConfig ¶
type ValidationConfig struct { Check []*ValidationItem `json:"check"` Errors []string `json:"errors"` Code int `json:"code"` }
type ValidationItem ¶
type VarTransformConfig ¶
type VarTransformConfig struct { JsonParse map[string]*JsonParseData `json:"parse"` Read map[string]*JsonRead `json:"read"` ToInteger map[string]string `json:"to_integer"` Transform map[string]string `json:"transform"` Clone map[string]string `json:"clone"` DefaultString map[string]string `json:"default_string"` Assign map[string]*AssignInfo `json:"assign"` DefaultAny map[string]string `json:"default_any"` FindRegExpr map[string]*PlaceRegExpression `json:"find"` ReplaceRegExpr map[string]*ReplaceRegExpression `json:"replace"` IncreaseVersion map[string]*IncreaseVersionInfo `json:"increase_version"` RemoveVars []string `json:"remove_vars"` CreateObject map[string]map[string]string `json:"create_object"` CreateArray map[string][]string `json:"create_array"` ConcatObjects *ConcatObjectInfo `json:"concat_objects"` ObjectByArray *ObjectByArrayInfo `json:"object_by_array"` ObjectByObject *ObjectByObjectInfo `json:"object_by_object"` RemoveByKeys *RemoveByKeysInfo `json:"remove_by_keys"` ReplaceText *ReplaceTextInfo `json:"replace_text"` ErrorMessage string `json:"error_message"` }
type VersionConfig ¶
type VersionConfig struct { Source string `json:"src"` Destination string `json:"dst"` SourcePath string `json:"srcPath"` DstPath string `json:"dstPath"` Mode string `json:"mode"` MainUpdate string `json:"mainUpdate"` VersionUpdate string `json:"versionUpdate"` VersionVarName string `json:"versionVarName"` KeyVarName string `json:"keyVarName"` }
Source Files ¶
- accesstoken.go
- actions.go
- collection.go
- comparejson.go
- dbmanager.go
- debughelp.go
- execstatements.go
- execute.go
- findchange.go
- foreach.go
- jsfile.go
- jsonconvert.go
- netaction.go
- ocaccess.go
- paging.go
- readfile.go
- saveread.go
- sse.go
- storageproviders.go
- storeaction.go
- systemaction.go
- upsert.go
- validate.go
- vartransform.go
- version.go