diff --git a/README.md b/README.md index a08b6cd..1c47217 100644 --- a/README.md +++ b/README.md @@ -289,6 +289,7 @@ Request data: - storage.Sequence(name, increaseWith) - generates next sequence with a given name, useful when auto generating id, if no increaseWith is passed or increaseWith = 0 the sequence won't be increased but the latest value will be returned - storage.SetValue(key, value) - stores a value corresponding to a given key and returns the value. This is useful if you have some entities requested by both id and name, so that you can store the mapping between than and later retrieve it. You can check the samples in [storage](config/persistence/storage/) folder - storage.GetValue(key) - returns the value corresponding to the given key + - dynamic.Calc(expression) - returns the result of a mathematical or logical expression > Regex: The regex should contain a group named **value** which will be matched and its value will be returned. E.g. if we want to match the id from this url **`/your/path/4`** the regex should look like **`/your/path/(?P\\d+)`**. Note that in *golang* the named regex group match need to contain a **P** symbol after the question mark. The regex should be prefixed either with **request.url.**, **request.body.** or **response.body.** considering your input. When setting the Persist.Collection field the regex can match multiple records from it's input, which is useful for cases like [users-delete-passingids.json](config/persistence/users-delete-passingids.json) diff --git a/http-api-mock.go b/http-api-mock.go index 2fb2033..ee34ce4 100644 --- a/http-api-mock.go +++ b/http-api-mock.go @@ -29,7 +29,7 @@ var ErrNotFoundDefaultPath = errors.New("We can't determinate the current path") var ErrNotFoundAnyMock = errors.New("No valid mock definition found") func banner() { - fmt.Println("HTTP API Mock v 1.1.3") + fmt.Println("HTTP API Mock v 1.1.5") fmt.Println("") fmt.Print(