{"modulePath":"github.com/highwire/http-api-mock","version":"v1.0.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Functions\n\n```go\nfunc FormatJSON(input string) (result string, err error)\n```\nFormatJSON formats a JSON string\n\n```go\nfunc GetServerAddress() string\n```\nGetServerAddress returns ServerAddress variable\n\n```go\nfunc IsJSON(s string) bool\n```\nIsJSON checks if a string is valid JSON or not\n\n```go\nfunc JSONSStringsAreEqual(input1 string, input2 string) (result bool, err error)\n```\nJSONSStringsAreEqual checks whether two JSON strings are actually equal JSON objects\n\n```go\nfunc JoinContent(value1 string, value2 string) string\n```\nJoinContent returns two contents joined as JSON if both are JSONs otherwise concatenates them\n\n```go\nfunc JoinJSON(inputs ...string) string\n```\nJoinJSON merges two JSON strings\n\n```go\nfunc SetServerAddress(address string)\n```\nSetServerAddress sets ServerAddress variable\n\n```go\nfunc UnWrapNonJSONStringIfNeeded(input string) string\n```\nUnWrapNonJSONStringIfNeeded wrapps non JSON string in NonJSONItem object\n\n```go\nfunc WrapNonJSONStringIfNeeded(input string) (result string, err error)\n```\nWrapNonJSONStringIfNeeded wrapps non JSON string in NonJSONItem object\n\n## Types\n\n```go\ntype Cartesian struct {\n}\n```\nCartesian gets all combinations of values for keys\n\n```go\nfunc (c Cartesian) CartesianDistribute(input [][]string) [][]string\n```\nCartesianDistribute getting full combinations distribution using cartesian combination algorithm - [http://stackoverflow.com/a/15310051/613113](http://stackoverflow.com/a/15310051/613113)\n\n```go\nfunc (c Cartesian) GetCombinations(inputMap map[string][]string) []map[string]string\n```\nGetCombinations returns an array of maps with all combinations built by a map with values \"key1\": \\[\"1\", \"2\"], \"key2\":\\[\"3\", \"4\"] -\u003e \\[{\"key1\":\"1\", \"key2\":\"3\"}, {\"key1\":\"1\", \"key2\":\"4\"}, {\"key1\":\"2\", \"key2\":\"3\"}, {\"key1\":\"2\", \"key2\":\"4\"}]\n\n```go\ntype RegexHelper struct {\n}\n```\n\n```go\nfunc (rh RegexHelper) GetCollectionItems(input string, getRegexParts func(string) (string, string, bool)) ([]string, bool)\n```\n\n```go\nfunc (rh RegexHelper) GetStringPart(input string, pattern string, groupName string) (string, bool)\n```\nGetStringPart gets the value of the group name matching the input using the pattern\n\n```go\ntype StaticVariables struct {\n\tServerAddress string\n}\n```\nVariables is used for storing static variables\n\n","path":"github.com/highwire/http-api-mock/utils","name":"utils","synopsis":"","isRedistributable":true}
