示例#1
0
func DecryptedAppDepData(data *types.AppDep) (map[string]interface{}, error) {
	// decrypt Data
	decryptedBytes := crypto.Decrypt([]byte(data.EncryptedData))
	dataMap := map[string]interface{}{}
	// Unmarshal JSON
	return dataMap, json.Unmarshal(decryptedBytes, &dataMap)
}
示例#2
0
func DecryptDependerEnvData(data *types.DependerEnvData) error {
	// decrypt Data to DataMap
	// decrypt Data
	decryptedBytes := crypto.Decrypt([]byte(data.EncryptedData))
	data.DataMap = map[string]interface{}{}
	// Unmarshal JSON to DataMap
	if err := json.Unmarshal(decryptedBytes, &data.DataMap); err != nil {
		return err
	}
	return nil
}