Documentation ¶
Index ¶
- Constants
- func CastToMap(in interface{}) (map[string]interface{}, error)
- func ClearOutputDirectory(dir string) error
- func CopyFile(source string, target string) error
- func ExitOnError(err error, message string)
- func Interface2Str(o interface{}) string
- func IsFileExist(file string) bool
- func IsFileExists(filename string) bool
- func JsonArrayFromFile(file_path string) ([]interface{}, error)
- func JsonFromFile(file_path string) (interface{}, error)
- func JsonMapFromFile(file_path string) (map[string]interface{}, error)
- func JsonToMap(b []byte) (map[string]interface{}, error)
- func ListFiles(path string) []string
- func MakeDirectory(dir string) error
- func ProcessTransform(dataBus map[string]interface{}, transform map[string]interface{}) (res map[string]interface{}, err error)
- func ReadFile(source string) ([]byte, error)
- func RemoveFile(file string) error
- func RemoveFolder(file string) error
- func TransformData(input map[string]interface{}, output map[string]interface{}, ...) (res map[string]interface{}, err error)
- func TransformDataWithFile(input map[string]interface{}, output map[string]interface{}, ...) (res map[string]interface{}, err error)
- func TransformWithFile(dataBus map[string]interface{}, transformFile string) (res map[string]interface{}, err error)
- func WriteFile(filePath string, data ...string) error
- func WriteJsonFile(path string, data interface{}) (err error)
- type JsonPath
- type Transform
- func (c *Transform) AppendToList(list []interface{}, value interface{}, toFirst bool) []interface{}
- func (c *Transform) CheckFilterRecord(fields []string, values []interface{}, data map[string]interface{}, isAnd bool, ...) (success bool)
- func (c *Transform) CheckValueRecord(obj interface{}, values []interface{}, compareType string) bool
- func (c *Transform) CompareDateTime(v1 interface{}, v2 interface{}, compareType string, format string, ...) (bool, error)
- func (c *Transform) CompareNumber(vi interface{}, vj interface{}) int
- func (c *Transform) CompareObject(obji interface{}, objj interface{}, valueType string, format string) int
- func (c *Transform) CompareString(vi interface{}, vj interface{}) int
- func (c *Transform) CompareTime(vi interface{}, vj interface{}, format string) int
- func (c *Transform) ConvertValueByType(value interface{}, strType string, defaultValue string) (interface{}, error)
- func (c *Transform) DecryptWithAes256Gcm(encryptedText string, passcode string) (string, error)
- func (c *Transform) DeleteOutputData(path string)
- func (c *Transform) DoConvertDmaToSsq(in interface{}, serviceName, ssqVersion, listName string) (resultData map[string]interface{}, err error)
- func (c *Transform) DoConvertSsqToDma(in interface{}) (resultData map[string]interface{}, resultSuccess bool, resultMessage string, ...)
- func (c *Transform) EncryptWithAes256Gcm(text string, passcode string) (string, error)
- func (c *Transform) FindValuesByRegExp(obj interface{}, strRegExp string) ([]string, error)
- func (c *Transform) FormatNaming(str string, format string) string
- func (c *Transform) FormatNumber(num float64, intDigit int64, padding string, decDigit int64, ...) string
- func (c *Transform) GetBasicConfig(transform interface{}) (*TransformConfig, error)
- func (c *Transform) GetIndexValue(indexKey string, maxIndex int) int
- func (c *Transform) GetInputBus() *JsonPath
- func (c *Transform) GetNameFromPath(path string) (name string)
- func (c *Transform) GetNumberInString(obj interface{}) (float64, error)
- func (c *Transform) GetOutput() map[string]interface{}
- func (c *Transform) GetOutputBus() *JsonPath
- func (c *Transform) GetParentFromPath(path string) (parent string)
- func (c *Transform) HpiAddObjectToList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiAddToList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiAes256GcmDecode(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiAes256GcmEncode(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiBase64Decode(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiBase64Encode(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCalculateNumber(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCheckExistingField(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCheckValue(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCompareDateTime(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCompareNumber(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCompareString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCopyFromList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCopyFromListToObject(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCopyObjectToSameParent(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiCopyToList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDateFormat(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDateToTimeStamp(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDecreaseNumber(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDeleteField(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDeleteRecord(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiDmaToSsqDataFormat(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiFilterRecord(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiFindOneRecord(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiFindValuesByRegExp(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiFixValue(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGenUUID(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGenUniqueID(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGetCurrentTime(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGetCurrentTimeStamp(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGetKeysInMap(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiGetValuesInMap(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiIncreaseNumber(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiJoinList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiJsonToString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiListSize(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiMathUtil(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiMergeString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiModifyString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiNameFormat(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiNumberFormat(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiRandomAlphabet(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiRandomInteger(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiRenameFields(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiReplaceString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSearchValueInList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSortList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSplitListToObject(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSplitString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSplitStringArray(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSsqToDmaDataFormat(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiStringToJson(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiSumFieldsInList(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiTimeStampToDate(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiToBoolean(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiToNumber(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiTrimString(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiUpdateRecord(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) HpiValidateAndCopy(tConfig interface{}) (output map[string]interface{}, err error)
- func (c *Transform) IsEqual(v1 interface{}, v2 interface{}, compareType string) bool
- func (c *Transform) JoinRecord(fields1 []string, fields2 []string, data1 map[string]interface{}, ...) (data3 map[string]interface{}, success bool)
- func (c *Transform) RemoveIndexInList(list []interface{}, index int) []interface{}
- func (c *Transform) ReverseString(s string) string
- func (c *Transform) SetOutputData(path string, value interface{})
- func (c *Transform) SortList(list []interface{}, sortType string, field string, valueType string, ...) []interface{}
- func (c *Transform) SortListMap(list []interface{}, sortType string, field string, valueType string, ...) []interface{}
- func (c *Transform) SortListObject(list []interface{}, sortType string, valueType string, format string) []interface{}
- func (c *Transform) ToArrayFields(fields string) []string
- func (c *Transform) ToArrayValues(values string) (valArr []interface{})
- func (c *Transform) ToBoolean(value interface{}) bool
- func (c *Transform) ToFloat64(value interface{}) (float64, error)
- func (c *Transform) ToInt64(value interface{}) (int64, error)
- func (c *Transform) ToString(value interface{}) (string, error)
- func (c *Transform) ToValueParam(inValue interface{}) (value interface{})
- func (c *Transform) Validate(trnsConf *TransformConfig, expectedType string, needInput bool, ...) error
- func (c *Transform) ValidateList(data interface{}) (list []interface{}, err error)
- func (c *Transform) ValidateListOfMap(data interface{}) (list []interface{}, err error)
- func (c *Transform) ValidateNullData(config *TransformConfig, checkEmpty bool) (err error)
- func (c *Transform) ValidateObjectByType(data interface{}, validateType string) bool
- type TransformConfig
- type TransformConfigFile
Constants ¶
const HPI_TType_AddObjectToList = "add_object_to_list"
const HPI_TType_AddToList = "add_to_list"
const HPI_TType_Aes256GcmDecode = "aes256gcm_decode"
const HPI_TType_Aes256GcmEncode = "aes256gcm_encode"
const HPI_TType_Base64Decode = "base64_decode"
const HPI_TType_Base64Encode = "base64_encode"
const HPI_TType_CalculateNumber = "calculate_number"
const HPI_TType_CheckExistingField = "check_existing_field"
const HPI_TType_CheckValue = "check_value"
const HPI_TType_CompareDateTime = "compare_date_time"
const HPI_TType_CompareNumber = "compare_number"
const HPI_TType_CompareString = "compare_string"
const HPI_TType_CopyFromList = "copy_from_list"
const HPI_TType_CopyFromListToObject = "copy_from_list_to_object"
const HPI_TType_CopyObjectToSameParent = "copy_object_to_same_parent"
const HPI_TType_CopyToList = "copy_to_list"
const HPI_TType_DateFormat = "date_format"
const HPI_TType_DateToTimeStamp = "date_to_timestamp"
const HPI_TType_DecreaseNum = "decrease_num"
const HPI_TType_DeleteField = "delete_field"
const HPI_TType_DeleteRecord = "delete_record"
const HPI_TType_DmaToSsq = "dma_to_ssq"
const HPI_TType_FilterRecord = "filter_record"
const HPI_TType_FindOneRecord = "find_one_record"
const HPI_TType_FindValuesByRegExp = "find_values_by_regexp"
const HPI_TType_FixValue = "fix_value"
const HPI_TType_GenUUID = "gen_uuid"
const HPI_TType_GenUniqueId = "gen_uniqueId"
const HPI_TType_GetCurrentTime = "get_current_time"
const HPI_TType_GetCurrentTimeStamp = "get_current_timestamp"
const HPI_TType_GetKeysInMap = "get_keys_in_map"
const HPI_TType_GetValuesInMap = "get_values_in_map"
const HPI_TType_IncreaseNum = "increase_num"
const HPI_TType_JoinList = "join_list"
const HPI_TType_JsonToString = "json_to_string"
const HPI_TType_ListSize = "list_size"
const HPI_TType_MathUtil = "math_util"
const HPI_TType_MergeString = "merge_string"
const HPI_TType_ModifyString = "modify_string"
const HPI_TType_NameFormat = "name_format"
const HPI_TType_NumberFormat = "number_format"
const HPI_TType_RandomAlphabet = "random_alphabet"
const HPI_TType_RandomInteger = "random_int"
const HPI_TType_RenameFields = "rename_fields"
const HPI_TType_ReplaceString = "replace_string"
const HPI_TType_SearchValueInList = "search_value_in_list"
const HPI_TType_SortList = "sort_list"
const HPI_TType_SplitListToObject = "split_list_to_object"
const HPI_TType_SplitString = "split_string"
const HPI_TType_SplitStringArray = "split_string_array"
const HPI_TType_SsqToDma = "ssq_to_dma"
const HPI_TType_StringToJson = "string_to_json"
const HPI_TType_SumFieldsInList = "sum_fields_in_list"
const HPI_TType_TimeStampToDate = "timestamp_to_date"
const HPI_TType_ToBoolean = "to_boolean"
const HPI_TType_ToNumber = "to_number"
const HPI_TType_TrimString = "trim_string"
const HPI_TType_UpdateRecord = "update_record"
const HPI_TType_ValidateAndCopy = "validate_and_copy"
Variables ¶
This section is empty.
Functions ¶
func ClearOutputDirectory ¶
func ExitOnError ¶
func Interface2Str ¶
func Interface2Str(o interface{}) string
func IsFileExist ¶
func IsFileExists ¶
func JsonArrayFromFile ¶
func JsonFromFile ¶
func JsonMapFromFile ¶
func MakeDirectory ¶
func ProcessTransform ¶
func ProcessTransform(dataBus map[string]interface{}, transform map[string]interface{}) (res map[string]interface{}, err error)
ProcessTransform is function to transfrom data in dataBus by transform configuration
func RemoveFile ¶
func RemoveFolder ¶
func TransformData ¶
func TransformData(input map[string]interface{}, output map[string]interface{}, transform map[string]interface{}) (res map[string]interface{}, err error)
TransformData is function to transfrom data by transform configuration
func TransformDataWithFile ¶
func TransformDataWithFile(input map[string]interface{}, output map[string]interface{}, transformFile string) (res map[string]interface{}, err error)
TransformDataWithFile is function to transfrom data by transform config path
func TransformWithFile ¶
func TransformWithFile(dataBus map[string]interface{}, transformFile string) (res map[string]interface{}, err error)
Transform is function to transfrom data in dataBus by transform config path
func WriteJsonFile ¶
WriteJsonFile is function to write json data to file
Types ¶
type JsonPath ¶
type JsonPath struct {
Root *map[string]interface{} `structs:"root" json:"root" bson:"root"`
}
JsonPath is data model of root of path
func NewJsonPathWithRoot ¶
Create new json path
type Transform ¶
type Transform struct { // Input data Input interface{} `structs:"input" json:"input" bson:"input"` // Output data if you want to merge function Output interface{} `structs:"output" json:"output" bson:"output"` // Shared databus between transform function InputBus *JsonPath `structs:"inputBus" json:"inputBus" bson:"inputBus"` OutputBus *JsonPath `structs:"outputBus" json:"outputBus" bson:"outputBus"` // Flag to ignore converting output databus to map IgnoreReturn bool `structs:"ignoreReturn" json:"ignoreReturn" bson:"ignoreReturn"` }
func (*Transform) AppendToList ¶
AppendToList is function to append data by first or last index
func (*Transform) CheckFilterRecord ¶
func (c *Transform) CheckFilterRecord(fields []string, values []interface{}, data map[string]interface{}, isAnd bool, compareType string) (success bool)
CheckFilterRecord is function to check condition for filtering record
func (*Transform) CheckValueRecord ¶
func (c *Transform) CheckValueRecord(obj interface{}, values []interface{}, compareType string) bool
CheckValueRecord is function to check condition for filtering record
func (*Transform) CompareDateTime ¶
func (c *Transform) CompareDateTime(v1 interface{}, v2 interface{}, compareType string, format string, valueType string) (bool, error)
CheckValueRecord is function to check condition for filtering record
func (*Transform) CompareNumber ¶
CompareNumber is function to compare number value
func (*Transform) CompareObject ¶
func (c *Transform) CompareObject(obji interface{}, objj interface{}, valueType string, format string) int
CompareObject is function to compare object by type
func (*Transform) CompareString ¶
CompareString is function to compare string value
func (*Transform) CompareTime ¶
CompareTime is function to compare date time
func (*Transform) ConvertValueByType ¶
func (c *Transform) ConvertValueByType(value interface{}, strType string, defaultValue string) (interface{}, error)
ConvertValueByType is function to convert value by type
func (*Transform) DecryptWithAes256Gcm ¶
DecryptWithAes256Gcm is function to decrypt with AES256GCM
func (*Transform) DeleteOutputData ¶
DeleteOutputData is function to delete output field
func (*Transform) DoConvertDmaToSsq ¶
func (c *Transform) DoConvertDmaToSsq(in interface{}, serviceName, ssqVersion, listName string) (resultData map[string]interface{}, err error)
DoConvertDmaToSsq is function convertion logic
func (*Transform) DoConvertSsqToDma ¶
func (c *Transform) DoConvertSsqToDma(in interface{}) (resultData map[string]interface{}, resultSuccess bool, resultMessage string, err error)
doConvertSsqToDma is function convertion logic
func (*Transform) EncryptWithAes256Gcm ¶
EncryptWithAes256Gcm is function to encrypt with AES256GCM
func (*Transform) FindValuesByRegExp ¶
FindValuesByRegExp is function find values by reqular expression
func (*Transform) FormatNaming ¶
FormatNaming is function to format naming
func (*Transform) FormatNumber ¶
func (c *Transform) FormatNumber(num float64, intDigit int64, padding string, decDigit int64, thousandSeparator string, decimalSeparator string) string
FormatNumber is function to format number and return string format
func (*Transform) GetBasicConfig ¶
func (c *Transform) GetBasicConfig(transform interface{}) (*TransformConfig, error)
GetBasicConfig is function to get basic data of transfrom
func (*Transform) GetIndexValue ¶
GetIndexValue is function to get index value in array
func (*Transform) GetInputBus ¶
GetInputBus is function to create inputBus if it is null and return it
func (*Transform) GetNameFromPath ¶
GetNameFromPath is function to get only name from full path
func (*Transform) GetNumberInString ¶
GetNumberInString function to get number in string
func (*Transform) GetOutputBus ¶
GetOutputBus is function to create outbutBus if it is null and return it
func (*Transform) GetParentFromPath ¶
GetParentFromPath is function to get only parent from full path
func (*Transform) HpiAddObjectToList ¶
func (c *Transform) HpiAddObjectToList(tConfig interface{}) (output map[string]interface{}, err error)
HpiAddObjectToList is function to add object to the list at first or last record
func (*Transform) HpiAddToList ¶
HpiAddToList is function to add value of some field to the list at first or last record
func (*Transform) HpiAes256GcmDecode ¶
func (c *Transform) HpiAes256GcmDecode(tConfig interface{}) (output map[string]interface{}, err error)
HpiAes256GcmDecode is function to decode string to AES256-GCM
func (*Transform) HpiAes256GcmEncode ¶
func (c *Transform) HpiAes256GcmEncode(tConfig interface{}) (output map[string]interface{}, err error)
HpiAes256GcmEncode is function to encode string to AES256-GCM
func (*Transform) HpiBase64Decode ¶
HpiBase64Decode is function to decode base64 to string value
func (*Transform) HpiBase64Encode ¶
HpiBase64Encode is function to encode string to base64
func (*Transform) HpiCalculateNumber ¶
func (c *Transform) HpiCalculateNumber(tConfig interface{}) (output map[string]interface{}, err error)
HpiCalculateNumber is function to calculate number value
func (*Transform) HpiCheckExistingField ¶
func (c *Transform) HpiCheckExistingField(tConfig interface{}) (output map[string]interface{}, err error)
HpiCheckExistingField is function to check existing field in object
func (*Transform) HpiCheckValue ¶
HpiCheckValue is function to check value whether it's match with config value
func (*Transform) HpiCompareDateTime ¶
func (c *Transform) HpiCompareDateTime(tConfig interface{}) (output map[string]interface{}, err error)
HpiCompareDateTime is function to compare date and time
func (*Transform) HpiCompareNumber ¶
func (c *Transform) HpiCompareNumber(tConfig interface{}) (output map[string]interface{}, err error)
HpiCompareNumber is function to compare number value
func (*Transform) HpiCompareString ¶
func (c *Transform) HpiCompareString(tConfig interface{}) (output map[string]interface{}, err error)
HpiCompareString is function to compare string value
func (*Transform) HpiCopyFromList ¶
HpiCopyFromList is function to copy field inside of list to target path
func (*Transform) HpiCopyFromListToObject ¶
func (c *Transform) HpiCopyFromListToObject(tConfig interface{}) (output map[string]interface{}, err error)
HpiCopyFromListToObject is function to copy data from list to object
func (*Transform) HpiCopyObjectToSameParent ¶
func (c *Transform) HpiCopyObjectToSameParent(tConfig interface{}) (output map[string]interface{}, err error)
HpiCopyObjectToSameParent is function to copy value in the map to same parent of output
func (*Transform) HpiCopyToList ¶
HpiCopyToList is function to copy value from field and put it to all records in list
func (*Transform) HpiDateFormat ¶
HpiGetCurrentTime is function to get current time from this system
func (*Transform) HpiDateToTimeStamp ¶
func (c *Transform) HpiDateToTimeStamp(tConfig interface{}) (output map[string]interface{}, err error)
HpiDateToTimeStamp is function to convert date to time stamp
func (*Transform) HpiDecreaseNumber ¶
func (c *Transform) HpiDecreaseNumber(tConfig interface{}) (output map[string]interface{}, err error)
HpiDecreaseNumber is function to decrease number
func (*Transform) HpiDeleteField ¶
HpiDeleteField is function to delete field form data bus
func (*Transform) HpiDeleteRecord ¶
HpiDeleteRecord is function to delete some record in list
func (*Transform) HpiDmaToSsqDataFormat ¶
func (c *Transform) HpiDmaToSsqDataFormat(tConfig interface{}) (output map[string]interface{}, err error)
HpiDmaToSsqDataFormat is function to convert DMA response data to SSQ request data format
func (*Transform) HpiFilterRecord ¶
HpiFilterRecord is function to filter some match record condition in list
func (*Transform) HpiFindOneRecord ¶
func (c *Transform) HpiFindOneRecord(tConfig interface{}) (output map[string]interface{}, err error)
HpiFindOneRecord is function to find match one record condition in list
func (*Transform) HpiFindValuesByRegExp ¶
func (c *Transform) HpiFindValuesByRegExp(tConfig interface{}) (output map[string]interface{}, err error)
HpiFindValuesByRegExp is function to find values by regular expression
func (*Transform) HpiFixValue ¶
HpiFixValue is function to declare field and its value
func (*Transform) HpiGenUUID ¶
HpiGenUUID is function to generate uuid by num bit of string
func (*Transform) HpiGenUniqueID ¶
HpiGenUniqueID is function to generate uniqueID by num bit of string
func (*Transform) HpiGetCurrentTime ¶
func (c *Transform) HpiGetCurrentTime(tConfig interface{}) (output map[string]interface{}, err error)
HpiGetCurrentTime is function to get current time from this system
func (*Transform) HpiGetCurrentTimeStamp ¶
func (c *Transform) HpiGetCurrentTimeStamp(tConfig interface{}) (output map[string]interface{}, err error)
HpiGetCurrentTimeStamp is function to get current time from this system
func (*Transform) HpiGetKeysInMap ¶
HpiGetKeys is function to list key of map value to output
func (*Transform) HpiGetValuesInMap ¶
func (c *Transform) HpiGetValuesInMap(tConfig interface{}) (output map[string]interface{}, err error)
HpiGetValuesInMap is function to get values by key of map value to output
func (*Transform) HpiIncreaseNumber ¶
func (c *Transform) HpiIncreaseNumber(tConfig interface{}) (output map[string]interface{}, err error)
HpiIncreaseNumber is function to increase number
func (*Transform) HpiJoinList ¶
HpiJoinList is function to join two list by some field and return it to output list
func (*Transform) HpiJsonToString ¶
HpiJsonToString is function to convert json object to json string
func (*Transform) HpiListSize ¶
HpiListSize is function to count size of the list
func (*Transform) HpiMathUtil ¶
HpiMathUtil is function about utilities of math package
func (*Transform) HpiMergeString ¶
HpiMergeString is function to merge field in input param to output param with combine text
func (*Transform) HpiModifyString ¶
HpiModifyString is function to modify the string and set it back to output
func (*Transform) HpiNameFormat ¶
HpiNameFormat is function to format string by naming type
func (*Transform) HpiNumberFormat ¶
HpiNumberFormat is function to format the number value to string format
func (*Transform) HpiRandomAlphabet ¶
func (c *Transform) HpiRandomAlphabet(tConfig interface{}) (output map[string]interface{}, err error)
HpiRandomAlphabet is function to random alphabet for transform node
func (*Transform) HpiRandomInteger ¶
func (c *Transform) HpiRandomInteger(tConfig interface{}) (output map[string]interface{}, err error)
HpiRandomInteger is function to random integer for transform node
func (*Transform) HpiRenameFields ¶
HpiRenameFields is function to rename field from input to output
func (*Transform) HpiReplaceString ¶
func (c *Transform) HpiReplaceString(tConfig interface{}) (output map[string]interface{}, err error)
HpiReplaceString is function to replace string from old strong to new string
func (*Transform) HpiSearchValueInList ¶
func (c *Transform) HpiSearchValueInList(tConfig interface{}) (output map[string]interface{}, err error)
HpiSearchValueInList is function to search value of each record in the list
func (*Transform) HpiSortList ¶
HpiSortList is function to sort data in the list
func (*Transform) HpiSplitListToObject ¶
func (c *Transform) HpiSplitListToObject(tConfig interface{}) (output map[string]interface{}, err error)
HpiSplitListToObject is function to split list to object and set it to output
func (*Transform) HpiSplitString ¶
HpiSplitString is function to split field value in input param to output param with split text
func (*Transform) HpiSplitStringArray ¶
func (c *Transform) HpiSplitStringArray(tConfig interface{}) (output map[string]interface{}, err error)
HpiSplitStringArray is function to split field value in input param to output param with split text
func (*Transform) HpiSsqToDmaDataFormat ¶
func (c *Transform) HpiSsqToDmaDataFormat(tConfig interface{}) (output map[string]interface{}, err error)
HpiSsqToDmaDataFormat is function to convert SSQ response data to DMA request data format
func (*Transform) HpiStringToJson ¶
HpiStringToJson is function to convert string to json object
func (*Transform) HpiSumFieldsInList ¶
func (c *Transform) HpiSumFieldsInList(tConfig interface{}) (output map[string]interface{}, err error)
SumFieldsInList is function to sum value of field in list
func (*Transform) HpiTimeStampToDate ¶
func (c *Transform) HpiTimeStampToDate(tConfig interface{}) (output map[string]interface{}, err error)
HpiTimeStampToDate is function to convert time stamp to date format
func (*Transform) HpiToBoolean ¶
HpiToBoolean is function to convert other type to boolean
func (*Transform) HpiToNumber ¶
HpiToNumber is function to convert other type to number data
func (*Transform) HpiTrimString ¶
HpiTrimString is function to remove all white space form string
func (*Transform) HpiUpdateRecord ¶
HpiCopyToList is function to copy value from field and put it to all records in list
func (*Transform) HpiValidateAndCopy ¶
func (c *Transform) HpiValidateAndCopy(tConfig interface{}) (output map[string]interface{}, err error)
HpiValidateAndCopy is function to validate value before copy it to output
func (*Transform) JoinRecord ¶
func (c *Transform) JoinRecord(fields1 []string, fields2 []string, data1 map[string]interface{}, data2 map[string]interface{}, isAnd bool) (data3 map[string]interface{}, success bool)
JoinRecord is function to join record by some field and condition
func (*Transform) RemoveIndexInList ¶
RemoveIndexInList is function to remove index in list
func (*Transform) ReverseString ¶
ReverseString is function to reverse string value
func (*Transform) SetOutputData ¶
SetOutputData is function to set output data by path
func (*Transform) SortList ¶
func (c *Transform) SortList(list []interface{}, sortType string, field string, valueType string, format string) []interface{}
SortList is function to sort list
func (*Transform) SortListMap ¶
func (*Transform) SortListObject ¶
func (*Transform) ToArrayFields ¶
ToFieldArray is function to convert fields that it's saparated by comma to array
func (*Transform) ToArrayValues ¶
ToArrayValues is function to convert value and separated by comma to array value
func (*Transform) ToValueParam ¶
func (c *Transform) ToValueParam(inValue interface{}) (value interface{})
ToValueParam is function to convert value from sting and $param
func (*Transform) Validate ¶
func (c *Transform) Validate(trnsConf *TransformConfig, expectedType string, needInput bool, needOutput bool) error
Validate is function to validate transform type and input output data
func (*Transform) ValidateList ¶
ValidateList is function to validate list
func (*Transform) ValidateListOfMap ¶
ValidateListOfMap is function to validate list of map
func (*Transform) ValidateNullData ¶
func (c *Transform) ValidateNullData(config *TransformConfig, checkEmpty bool) (err error)
ValidateNullData is function to validate null and empty data
func (*Transform) ValidateObjectByType ¶
ValidateObjectByType is function to validate object by validate type
type TransformConfig ¶
type TransformConfig struct { Input []string `structs:"input" json:"input" bson:"input"` Output []string `structs:"output" json:"output" bson:"output"` Type string `structs:"type" json:"type" bson:"type"` Split string `structs:"split" json:"split" bson:"split"` Combine string `structs:"combine" json:"combine" bson:"combine"` Compare string `structs:"compare" json:"compare" bson:"compare"` Format string `structs:"format" json:"format" bson:"format"` From string `structs:"from" json:"from" bson:"from"` To string `structs:"to" json:"to" bson:"to"` Position string `structs:"position" json:"position" bson:"position"` Num int64 `structs:"num" json:"num" bson:"num"` Step int64 `structs:"step" json:"step" bson:"step"` ValueType string `structs:"valueType" json:"valueType" bson:"valueType"` Value string `structs:"value" json:"value" bson:"value"` Index string `structs:"index" json:"index" bson:"index"` Fields string `structs:"fields" json:"fields" bson:"fields"` Fields2 string `structs:"fields2" json:"fields2" bson:"fields2"` Operator string `structs:"operator" json:"operator" bson:"operator"` RegExp string `structs:"regexp" json:"regexp" bson:"regexp"` Prefix string `structs:"prefix" json:"prefix" bson:"prefix"` Suffix string `structs:"suffix" json:"suffix" bson:"suffix"` Center string `structs:"center" json:"center" bson:"center"` // Number Format IntDigit int64 `structs:"intDigit" json:"intDigit" bson:"intDigit"` Padding string `structs:"padding" json:"padding" bson:"padding"` DecDigit int64 `structs:"decDigit" json:"decDigit" bson:"decDigit"` ThousandSeparator string `structs:"thousandSeparator" json:"thousandSeparator" bson:"thousandSeparator"` DecimalSeparator string `structs:"decimalSeparator" json:"decimalSeparator" bson:"decimalSeparator"` }
TransformConfig is data model of transform configuration
type TransformConfigFile ¶
type TransformConfigFile struct { File string `structs:"file" json:"file" bson:"file"` Config map[string]interface{} `structs:"config" json:"config" bson:"config"` }
TransformConfigFile is data of transfrom config from file
Source Files ¶
- boolean_functions.go
- calculate_function.go
- compare_functions.go
- constant.go
- date_time_functions.go
- encrypt_functions.go
- field_functions.go
- json_function.go
- list_functions.go
- list_sort_functions.go
- map_functions.go
- model.go
- number_functions.go
- random_functions.go
- record_functions.go
- regexp_functions.go
- ssq_dma_function.go
- string_functions.go
- util_compare.go
- util_convert.go
- util_crypto.go
- util_file.go
- util_format.go
- util_json_path.go
- util_list.go
- util_list_sort.go
- util_param_query.go
- util_path.go
- util_reqexp.go
- util_transform_config.go
- util_validate.go
- zz_register_all.go
- zz_transform.go