All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.4.0 - 2024-03-15
- Added
FileBuilder.WithMustExist()
constraint. - Added
Dir()
builder for directory paths.
- Bumped minimum Go version to v1.22.
1.3.0 - 2024-03-14
- Added
StringBuilder.WithMinimumLength()
,WithMaximumLength()
,WithLength()
. - Added
BytesBuilder.WithMinimumLength()
,WithMaximumLength()
,WithLength()
.
- Fixed wording of error message when a variable exceeds the maximum length.
1.2.1 - 2023-08-14
- Dropped support for Go v1.19, which reached end-of-life on 2023-08-08
- Removed use of the
slices
andmaps
packages fromgolang.org/x/exp
. These package are not versioned and as such breaking changes can cause conflicts with other dependencies. The experimentalconstraints
package is still used, with the expectation that these will always remain valid for use as type parameter constraints.
1.2.0 - 2023-06-12
- Added
Registry
andNewRegistry()
- Added
RegistryOption
andWithDocumentationURL()
- Changed
WithRegistry()
to accept aferrite.Registry
instead of the experimentalvariable.Registry
type - Passing
WithRegistry()
toInit()
is now additive, instead of replacing the default registry
- Removed the experimental
maybe
andvariable
sub-packages
- Prevent registration of multiple environment variables with the same name
1.1.0 - 2023-06-06
- Added
Binary()
andBinaryAs()
builders for binary variables - Added
variable.LengthLimited
schema for values that have minimum or maximum lengths
variable.String
now implements the newLengthLimited
interface- Rename the
variable.[Min|Max]LengthError.String
field toViolatedSchema
and change its type toLengthLimited
- Removed "platform" examples from generated documentation. These are too
opinionated and organization-specific to be included in every project's
documentation. Instead, we will provide different export modes that can be
used to generate Docker/Kubernetes/etc configurations, similar to the existing
export/dotenv
mode.
1.0.3 - 2023-04-20
export/dotenv
mode now includes sensitive values in the output
1.0.2 - 2023-03-29
- Added
export
keyword to output ofexport/dotenv
mode
- Improve example values for
File()
builder
1.0.1 - 2023-03-28
- Render a table of environment variables in Markdown documentation instead of bullet points
- Simplify language in generated documentation
1.0.0 - 2023-03-17
- No changes from v0.6.0.
0.6.0 - 2023-03-14
- Added
SeeAlso()
option - Added
RelevantIf()
option
- [BC]
SupersededBy()
now accepts a single variable set and variadic options - [BC] Renamed
Input
toVariableSet
- Refactored internal
variable.Variable
to allow for more flexible implementations
- [BC] Removed
SeeAlso()
method from all builder types, use the newSeeAlso()
option instead
0.5.0 - 2023-03-12
- Added
SeeAlso()
method to all builders, which links to another variable for documentation purposes - Added
SupersededBy()
option, which indicates which variables to use instead of a deprecated one - Added
WithRegistry()
option to allow registration of variables in custom variable registries
- [BC] Floating point variables no longer accept
NaN
,+Inf
or-Inf
as valid values - [BC] Replaced
WithConstraintFunc()
withWithConstraint()
variable.Register()
now directly accepts aRegistry
instead of using functional options
- Removed
variable.Option
type andvariable.WithRegistry()
option
- Internal errors from
strconv.ParseXXX()
functions are no longer presented to the user verbatim
0.4.2 - 2023-03-11
- Added
export/dotenv
mode, which renders environment variables and their current values in dotenv format
- Fixed issue where durations were rendered with tailing zero-valued minute components
0.4.1 - 2023-03-10
- Markdown documentation is now rendered to
STDOUT
(instead ofSTDERR
) as intended
0.4.0 - 2023-03-10
- Added
Deprecated()
method to all builders, which marks the variable as deprecated and warns the user if it is defined - Added
StringBuilder.WithSensitiveContent()
, which hides the variable value from console output and generated documentation - Added functional options to
Init()
The following changes are technically not backwards compatible from a Go perspective, but under normal usage (as per the examples) they do not actually alter the usage of the Ferrite API.
- [BC]
NetworkPort()
now returns aNetworkPortBuilder
instead ofStringBuilder
- [BC]
Required[T]
andOptional[T]
are now structs instead of interfaces - [BC] All builder types now use pointer receivers
- [BC]
Require()
andOptional()
methods on all builders now use distinct option types
0.3.6 - 2023-03-06
- Fixed schema rendering of URL variables in validation mode
- Improved algorithm for choosing which example to show in generated usage documentation
0.3.5 - 2023-03-06
- Remove use of
strings.CutPrefix()
to maintain compatibility with Go v1.19
0.3.4 - 2023-03-05
- Generate Markdown documentation for the syntax of integers, floating-point values, URLs and network ports
- Other general improvements to generated Markdown documentation
- Trailing zeroes are no longer rendered on floating point values
0.3.3 - 2023-03-03
- Add
URL()
- Generated Markdown documentation now indicates whether example values are normative or non-normative
- Generated Markdown documentation now describes the format of duration variables
0.3.2 - 2022-11-30
- Add
Float()
- Add
File()
- Add
DurationBuilder.WithMinimum()
andWithMaximum()
- Add
SignedBuilder.WithMinimum()
andWithMaximum()
- Add
UnsignedBuilder.WithMinimum()
andWithMaximum()
0.3.1 - 2022-08-24
- Add
NetworkPort()
0.3.0 - 2022-08-15
- Added support for generating markdown documentation
0.2.0 - 2022-08-08
This is a fairly substantial refactor from the initial prototype, though usage is largely unchanged. See the examples for details.
The two most important changes in usage are:
ValidateEnvironment()
has been renamed toInit()
- Either
Optional()
orRequired()
must be called at the end of a builder chain
0.1.0 - 2022-08-03
- Initial release