Documentation ¶
Index ¶
- Variables
- func CalcExpression(expression string) (string, error)
- func FormatJSON(input string) (result string, err error)
- func GetJSONCompositePropertyValue(input string, property string) (string, error)
- func GetJSONProperty(input string, property string) (string, error)
- func GetPropertyValue(input string, property string) (string, error)
- func GetServerAddress() string
- func IsArray(data interface{}) bool
- func IsJSON(s string) bool
- func IsObject(data interface{}) bool
- func JSONDeserialize(input string) (map[string]interface{}, error)
- func JSONSStringsAreEqual(input1 string, input2 string) (result bool, err error)
- func JSONSerialize(input interface{}) (string, error)
- func JoinContent(value1 string, value2 string) string
- func JoinJSON(inputs ...*gabs.Container) *gabs.Container
- func SetServerAddress(address string)
- func UnWrapNonJSONStringIfNeeded(input string) string
- func WrapNonJSONStringIfNeeded(input string) (result string, err error)
- type Cartesian
- type RegexHelper
- type StaticVariables
Constants ¶
This section is empty.
Variables ¶
var ErrorPropertyMissingInJSON = errors.New("There is no such property in the JSON document")
ErrorPropertyMissingInJSON when there's no such property in the JSON document
Functions ¶
func CalcExpression ¶ added in v1.2.0
func FormatJSON ¶
FormatJSON formats a JSON string
func GetJSONCompositePropertyValue ¶ added in v1.2.0
GetJSONCompositePropertyValue returns composite property value digging inside complex JSON documents
func GetJSONProperty ¶ added in v1.2.0
GetJSONProperty returns the string value of a given property inside a JSON document
func GetPropertyValue ¶ added in v1.2.0
GetPropertyValue returns the json property value if input is json, otherwise tries to parse the value as query string and get property value
func GetServerAddress ¶
func GetServerAddress() string
GetServerAddress returns ServerAddress variable
func JSONDeserialize ¶ added in v1.2.0
JSONDeserialize deserializes a JSON string to interface map
func JSONSStringsAreEqual ¶
JSONSStringsAreEqual checks whether two JSON strings are actually equal JSON objects
func JSONSerialize ¶ added in v1.2.0
JSONSerialize serializes an inteface to JSON string
func JoinContent ¶
JoinContent returns two contents joined as JSON if both are JSONs otherwise concatenates them
func SetServerAddress ¶
func SetServerAddress(address string)
SetServerAddress sets ServerAddress variable
func UnWrapNonJSONStringIfNeeded ¶
UnWrapNonJSONStringIfNeeded wrapps non JSON string in NonJSONItem object
func WrapNonJSONStringIfNeeded ¶
WrapNonJSONStringIfNeeded wrapps non JSON string in NonJSONItem object
Types ¶
type Cartesian ¶
type Cartesian struct { }
Cartesian gets all combinations of values for keys
func (Cartesian) CartesianDistribute ¶
CartesianDistribute getting full combinations distribution using cartesian combination algorithm - http://stackoverflow.com/a/15310051/613113
func (Cartesian) GetCombinations ¶
GetCombinations returns an array of maps with all combinations built by a map with values "key1": ["1", "2"], "key2":["3", "4"] -> [{"key1":"1", "key2":"3"}, {"key1":"1", "key2":"4"}, {"key1":"2", "key2":"3"}, {"key1":"2", "key2":"4"}]
type RegexHelper ¶
type RegexHelper struct { }
func (RegexHelper) GetCollectionItems ¶
func (RegexHelper) GetStringPart ¶
GetStringPart gets the value of the group name matching the input using the pattern
type StaticVariables ¶
type StaticVariables struct {
ServerAddress string
}
Variables is used for storing static variables