Skip to content

Commit

Permalink
Documentation and version update
Browse files Browse the repository at this point in the history
  • Loading branch information
esabril committed Feb 26, 2020
1 parent 000b3d1 commit 1275b12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<value>\\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)
Expand Down
2 changes: 1 addition & 1 deletion http-api-mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1275b12

Please sign in to comment.