Releases: evg4b/uncors
v0.4.1
v0.4.0
What's Changed
- Use evg4b/goreleaser-npm-publisher-action for publishing to NPM by @evg4b in #35
- Adaptive color by @evg4b in #36
- Cleanup sonar issues by @evg4b in #38
- JSON schema fixup by @evg4b in #37
- Move seed to the fakedata response struct by @evg4b in #39
- URL Rewriting by @evg4b in #41
Full Changelog: v0.3.0...v0.4.0
v0.3.0
Fake data generator
Added ability to generate JSON based on JSONSchema-like configuration:
Object definition
type: object
seed: <randomizing-seed>
properties:
<property1-name>: <property1-value>
<property2-name>: <property2-value>
<property3-name>: <property3-value>
Where:
- - The seed for generator to freeze generated value
- <property1-name>, <property2-name>, etc - The names of the object properties.
- <property1-value>, <property1-value>, etc - The node definition for the corresponding properties.
For example the following configuration:
fake:
type: object
properties:
first-name:
type: firstname
last-name:
type: lastname
email:
type: email
phones:
type: array
item:
type: phoneformatted
count: 3
will produce next data (pay attention response was formatter for better readability):
{
"email": "amparobogan@hauck.org",
"first-name": "Kyla",
"last-name": "Tromp",
"phones": [
"646-197-4242",
"1-849-783-9215",
"1-953-147-0257"
]
}
Array definition
type: array
seed: <randomizing-seed>
item: <item-definition>
count: <items-count>
Where:
- - The seed for generator to freeze generated value
- - The node definition for array items.
- - Count of generated items.
For example the following configuration:
type: array
item:
type: object
properties:
first-name:
type: firstname
last-name:
type: lastname
about:
type: sentence
options:
wordcount: 15
count: 3
will produce next data (pay attention response was formatter for better readability):
[
{
"about":"Of most now summation whom pretty yet about scary thing shirt those an that within.",
"first-name":"Sheila",
"last-name":"Auer"
},
{
"about":"Whom fight sufficient my lately then been generally these knit quarterly of his there could.",
"first-name":"Precious",
"last-name":"Dicki"
},
{
"about":"Finnish Caesarian goal anybody tomorrow itself then entirely whale behind German regularly within boots this.",
"first-name":"Kody",
"last-name":"Larson"
}
]
Primitive types
To configure a concrete primitive type you can use folofing structure:
type: <data-type>
seed: <randomizing-seed>
options:
<param1>: <param1-value>
<param2>: <param2-value>
<param3>: <param3-value>
Where:
- - The key of function generator
- - The seed for generator to freeze generated value
- <param1>, <param2>, etc - The keys of options for
<data-type>
function. - <param1-value>, <param2-value>, etc - The values of the corresponding parameters for the generator function.
Example of configuration for sentence
data:
type: sentence
options:
wordcount: 15
That will provide value like this:
"Themselves sock are fly noisily over before secondly nest theirs next is bunch his alternatively."
Changed console render library
We have updated uncors to use lipgloss as style lib.
Changelog
- 2f99e5b Added make file
- 4430c04 Added makefile
- adc2d77 Change console render library (#29)
- 18f2f19 Create codeql.yml
- 1f3d952 Fake Data generator (#33)
- 3731349 Fixed makefile
- 0befa1e Fixed race issue (#30)
- 4eb1815 Json schema tests (#31)
- fdb84db Merge workflows
- 95cecf6 Update README.md
- 8e9be18 Updated README.md
- abfd5f3 Updated README.md
- fcd0cec Updated code
- a3976c8 Updated codebase
- 877e58b Updated deps
- c3f7959 Updated go and golangci-lint
- a5a41e8 Updated goreleaser version
- 80d934b Updated linter
- 3f76b93 Updated packages
- 161af3c Updated packages
- 15400e8 Updated packages
- 4e1f712 Updated packages
- 647c406 Updated packages and fix linter isses
- e336348 Updated readme
- aa75a99 Updated roadmap
v0.2.2
Bugfixing
- Fixed a bug with incorrect Сontent-Encoding on the error page
- Added logging for default handler errors
Changelog
- cc683a7 Added tests for formatting
- fd47bfd Fix lint issues
- 234b7a3 Fixed linter issues
- 746dcbc Implement options ApplyOptions helper
- e2df7d1 Improved error page
- e65e309 Logged error in default handler
- fe3f161 Moved constants
- 4bf4400 Removed unused params
- 794a148 Replaced domains in cookies
- a12610c Update README.md
- c3a0a47 Updated dependencies
- 75df3b6 Updated dependencies
- 539f68e Updated dependencies
- 19de805 Updated readme.md
v0.2.1
v0.2.0
Response caching
Added in memory response caching for requests. That allows to reduce response time for requests that are repeated often
or have long response time.
Each mapping has own cache settings that can be configured in config file.
mappings:
- from: localhost
to: https://github.com
cache:
/api/path
/other-path
By default, cached only GET requests. To enable caching for other methods use methods
option in cache-config
section:
mappings:
- from: localhost
to: https://github.com
cache: [...]
cache-config:
methods:
- GET
- POST
- PUT
Also, you can configure cache expiration time and cache clear time.
mappings:
- from: localhost
to: https://github.com
cache: [...]
cache-config:
methods: [GET, POST]
expiration-time: 10m
clear-time: 1h
Config Schema file
Added JSON Schema for configuration file
- Schema URL:
https://raw.githubusercontent.com/evg4b/uncors/develop/schema.json
- Schema version: JSON Schema version 4
- File paths patterns:
*.uncors.yml
,*.uncors.yaml
,.uncors.yml
,.uncors.yaml
Other points
- Automatically restarts the server after configuration files change.
- Config file validation before starting or reloading the server
Changelog
- 53a4dc1 Added json schema for configuration file (#19)
- 05125c2 Added helpers.CloseSafe method
- dc0b088 Added new error page
- 5b07b9f Added panics for high level structures
- ff0e8fa Added short commands
- ff31e1f Added static response printing
- 3115193 Added tests for debug panic interceptor
- 43a6bc4 Added tests for sfmt package
- 8b7606b Automatically reload the server after configuration changes (#22)
- 8580c14 Bump golang.org/x/net from 0.10.0 to 0.17.0 (#23)
- d88bdcb Changed correct errors message ordering
- cb06878 Cleanup
- b77ba94 Cleanup code
- 50f65b9 Cleanup code
- de83f47 Cleanup code
- f2c462d Cleanup code: WIP 1
- 1e8d2af Cleanup code: WIP 2
- fe447f2 Cleanup code: WIP 3
- 374daac Cleanup code: WIP 4
- b76b08d Cleanup code: WIP 4
- b6bb5c0 Cleanup deps
- ed416c0 Cleared test output
- bb9fe44 Code cleanup
- 603c18a Custom config mapping (#13)
- aa9b0ed Fix missing error notification
- f050d79 Fixed cross-domain caching issue
- 2a2d20d Fixed goreleaser pipeline
- d3a5c02 Fixed issue caching between methods
- df651fd Fixed mock waiting issue
- 91c5e10 Fixed tests
- 85847be Fixed tests after upgrading
- 201b14c Move all structures to configuration
- bc0853b Reafactoring
- 8f0de5e Refactor debug output for logger
- d4cda47 Refactored code
- f6529c6 Refactoring: Created appbuilder for tests
- d8b85ee Refactoring: hosts constants
- 273475d Rename configuration module to config
- 3c99b3c Rename infrastructure module to infra
- 62da2c6 Renamed config property raw-content to raw
- 9b4bbcf Reorganize dependencies providing (#21)
- 7fd4842 Response caching (#17)
- fe8e328 Restored validation for correct host name in replacer
- c3fcd5b Separated mock for each url mapping (#16)
- 665e6ea Squashed commit of the following:
- 4b7a562 Static file serving (#15)
- d4291b4 Update README.md
- 017904a Update README.md
- 295492e Update dependencies
- 2267b71 Update roadmap
- 781e976 Updated README.md
- a134e00 Updated README.md
- 92e9f1f Updated README.md and ROADMAP.md
- db08d33 Updated README.md and ROADMAP.md
- ef0fdbf Updated README.md and ROADMAP.md
- 462a6fd Updated Roadmap
- 49a6070 Updated dependencies
- f751aa8 Updated deps
- f31dccd Updated deps
- 2fb7759 Updated deps
- 52c4e6a Updated golangci-lint
- aeb0531 Updated linter rules
- 9b99104 Updated npm-go-bin
- 1804163 Updated packages
- c8ac00d Updated readme
- 8c15020 Updated roadmap
- a9f786a Updated workflows
- b56e4a4 Updated workspace
- 749a8fa Upgrade dependencies
- 6412d27 Upgraded deps
- c744aba Upgraded env
v0.1.0
Changelog
- 05125c2 Added helpers.CloseSafe method
- dc0b088 Added new error page
- ff0e8fa Added short commands
- 43a6bc4 Added tests for sfmt package
- d88bdcb Changed correct errors message ordering
- b77ba94 Cleanup code
- de83f47 Cleanup code
- f2c462d Cleanup code: WIP 1
- 1e8d2af Cleanup code: WIP 2
- fe447f2 Cleanup code: WIP 3
- 374daac Cleanup code: WIP 4
- b76b08d Cleanup code: WIP 4
- ed416c0 Cleared test output
- 603c18a Custom config mapping (#13)
- df651fd Fixed mock waiting issue
- 201b14c Move all structures to configuration
- bc0853b Reafactoring
- 8f0de5e Refactor debug output for logger
- d4cda47 Refactored code
- 273475d Rename configuration module to config
- 3c99b3c Rename infrastructure module to infra
- 62da2c6 Renamed config property raw-content to raw
- c3fcd5b Separated mock for each url mapping (#16)
- 4b7a562 Static file serving (#15)
- 017904a Update README.md
- 295492e Update dependencies
- 2267b71 Update roadmap
- 781e976 Updated README.md
- a134e00 Updated README.md
- fce6cd5 Updated README.md
- 462a6fd Updated Roadmap
- 1804163 Updated packages
- c8ac00d Updated readme
- 8c15020 Updated roadmap
- b56e4a4 Updated workspace
0.0.9
- Added ability deley mock response via delay property:
mocks:
- path: /demo
method: GET
response:
code: 200
delay: 110s
raw-content: hello word
- Changed npm distribution library (fixed support npm 8.x)
Changelog
0.0.8-beta
0.0.8
- Added ability to pass multiple URL mappings from CLI arguments:
uncors --from host1.local --to host1.com --from host2.local --to host2.com ...
- Added ability to return mock content from file
- Added disclaimer message
- Added new version check
Changelog
- ebd7f80 Added disclaimer message
- 3596139 Added mocks content from file (#7)
- 4268734 Added new version check
- 1670ebd Added panic interceptor
- 0cfe5be Added space between information messages
- a530fbc Added viper configuration
- 8a156c1 Fixed sonar issues
- 2069d8e Make new middleware's (#6)
- 96e41d1 Refactoring
- 95abc9b Update deps
- 2e2dc26 Updated README.md
- 8daeeb3 Updated linters
- 6044382 Updated new url mapping loading