Skip to content

Releases: nobl9/govy

v0.11.0

20 Nov 17:13
d65c01e
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add EqualProperties rule (#54) @nieomylnieja

    Added rules.EqualProperties rule which helps ensure selected properties are equal.
    The equality check is performed via a configurable function.
    Two builtin functions are provided out of the box: rules.CompareFunc which operates on comparable types and rules.CompareDeepEqualFunc which uses reflect.DeepEqual and operates on any type.

🧰 Maintenance

v0.10.0

19 Nov 15:40
85c7809
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add alphanumeric rules (#52) @nieomylnieja

    Added rules.StringAlpha, rules.StringAlphanumeric, rules.StringAlphaUnicode and rules.StringAlphanumericUnicode which help ensure strings contain only letters and numbers (either ASCII or Unicode).

v0.9.1

18 Nov 11:13
070e14f
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • fix: Predicate matching for govy.PropertyRules (#51) @nieomylnieja

    govy.PropertyRules will no longer fail if Required() was specified when a validate value is its type's zero value AND none of the When() conditions are matched.

🐞 Bug Fixes

v0.9.0

13 Nov 15:23
2b70de3
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add StringDateTime and StringTimeZone rules (#50) @nieomylnieja

    Added StringDateTime rule which ensures a string is a valid date and time according to the rules defined by https://pkg.go.dev/time.
    Added StringTimeZone rule which ensures a string is a valid IANA Time Zone database code.

🧰 Maintenance

v0.8.0

06 Nov 18:23
78d44fd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add AssertErrorContains (#47) @nieomylnieja

    Added govytest.AssertErrorContains function which helps test govy rules by checking if a produced govy.ValidatorError contains specified error.

v0.7.0

05 Nov 15:17
c2b1093
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • feat: Add cascade mode setting to Validator (#43) @nieomylnieja

    govy.CascadeMode enum now starts from 1 (previously 0).

  • feat: Allow converting rules for pointers (#42) @nieomylnieja

    govy.NewRuleSet now only accepts govy.Rule. Previously passing anything else into it would not work either.

🚀 Features

  • feat: Add benchmark report (#41) @nieomylnieja

    Benchmarks for govy can now be easily inspected and tracked over time.

  • feat: Add cascade mode setting to Validator (#43) @nieomylnieja

    Added govy.Validator.Cascade which allows controlling error handling on govy.Validator level and propagating the setting to govy.PropertyRules. For more details on cascade mode read this.

  • feat: Allow converting rules for pointers (#42) @nieomylnieja

    Added two functions: govy.RuleToPointer and govy.RuleSetToPointer which both convert respectively govy.Rule[T] and govy.RuleSet[T] to work on pointers of the same type: govy.Rule[*T] and govy.RuleSet[*T].
    govytest.ExpectedRuleError no longer requires PropertyName to be provided, this allows testing properties which have no name.

🧰 Maintenance

4 changes

v0.6.0

03 Nov 16:34
b366bbd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add StringCrontab rule (#40) @nieomylnieja

    Added StringCrontab rule which verifies if a string is a valid crontab schedule expression according to the rules defined by crontab.

  • feat: Add StringRegexp rule (#38) @nieomylnieja

    Added StringRegexp validation rule which verifies if a string is a valid regular expression according to https://pkg.go.dev/regexp/syntax rules.

v0.5.0

29 Oct 14:16
a1ec895
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add file system rules (#37) @nieomylnieja

    Added 4 new rules: StringFileSystemPath, StringFilePath, StringDirPath and StringMatchFileSystemPath, which help verify file system paths and patterns.

  • feat: Add StringGitRef rule (#35) @nieomylnieja

    Added StringGitRef validation rule which checks if a string is a valid git reference according to the rules defined by git-check-ref-format.

  • feat: Add benchmarks (#32) @nieomylnieja

    Added benchmarks to builtin rules.

  • feat: Support validating slices of objects (#30) @nieomylnieja

    Added new validator function for slices: govy.Validator.ValidateSlice. It can be used to validate a slice of values, where each value has the same type as the validator's type constraint. Internally it calls govy.Validator.Validate on each element and returns govy.ValidatorErrors.

🧰 Maintenance

4 changes

v0.4.0

02 Oct 13:47
364a5a5
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • chore: Simplify StringDNSLabel rule (#29) @nieomylnieja

    StringDNSLabel is no longer a RuleSet, instead it's now a single Rule.

🚀 Features

  • feat: Add WithNameFunc to Validator (#28) @nieomylnieja

    Added Validator.WithNameFunc function which can be used to dynamically set the validator's name per-instance.

🧰 Maintenance

v0.3.0

30 Sep 21:13
74b9792
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add test utilities (#25) @nieomylnieja

    Added govytest package which exposes utilities which help test govy validation rules.
    It comes with two functions AssertNoError, which ensures no error was produced, and AssertError which checks that the expected errors are equal to the actual govy.ValidatorError.
    Added OneOfProperties rule which checks if at least one of the properties is set.

🧰 Maintenance