Releases: qdm12/gosettings
Releases · qdm12/gosettings
v0.4.0-rc4
Breaking changes
- Move
reader/parse
tointernal/parse
Maintenance
- Upgrade dependency
golang.org/x/exp
- Upgrade CI Docker image Alpine from 3.16 to 3.18
- Upgrade Go from 1.20 to 1.21
- Upgrade actions/checkout from 3 to 4 (#12)
Features
reader
:- add builtin methods:
Int8
,Int16
,Int32
,Int64
,Int8Ptr
,Int16Ptr
,Int32Ptr
,Int64Ptr
,Float32
,Float32Ptr
andFloat64Ptr
- default reader sources are flags then env isntead of only env
- add builtin methods:
Documentation
- Simplify README.md reader Go code example
- Update reader example code to use flag and env instead of both sources as env
v0.4.0-rc3
Breaking changes
- Move environment variables source
env.go
to its ownreader/sources/env
package
Features
- Add flags source package
reader/sources/flag
v0.4.0-rc2
Breaking changes
reader
package which replaces allsources
packages- Merge functions in merge.go removed (now unneeded)
- Settings reader now reads from multiple sources in order
sources/merger
removedsources/env
removed (replaced byreader
package)- Define
Env
reader-compatibleSource
parse
package generic functions accept source interfaces instead of keyValues map- Update all code comments, example and readme
reader
package:New
takes a Settings struct as its unique argumentNumber
constraint andconstraints.go
file removed- Override:
OverrideWithComparable
function, replacingOverrideWithNumber
,OverrideWithString
,OverrideWithPointerRaw
,OverrideWithInterface
andOverrideWithSliceRaw
- Defaults:
DefaultComparable
function, replacingDefaultNumber
,DefaultString
,DefaultPointerRaw
,DefaultInterface
andDefaultSliceRaw
parse
package: try parsing the empty string ifAllowEmpty(true)
option is used
Features
reader
package: addDefaultOptions
field to theSettings
structreader
package: addFirstKeySet
function
Fixes
reader/parse
package:- settings default properly set
handleDeprecatedKey
function parseBool
returns a bool pointer
- settings default properly set
Documentation
- Review code comments
- fix godoc comments bullet list formatting
- fix godoc comments new lines formatting
- mention default settings for CSV methods
- change
the error context
toits message
- mention nil slices conditions for CSV methods
- review
AcceptEmpty
option comment
v0.4.0-rc1
Features
sources/env
: addCSVNetipAddresses
method
Fixes
validate
:ListeningAddress
accepts empty listening addresses
Documentation
sources/env
: fixCSVNetipPrefixes
method comment
v0.3.0
Features
- Add
ObfuscateKey
function - Add
BoolToYesNo
function - Add
DefaultPointerRaw
function sources/env
:- add
ForceLowercase
option - add
AcceptEmpty
option - add
String
function as a shorthand to return the empty string if the environment variable is not set or is the empty string. - add
Uint32Ptr
method - add
Duration
method BoolPtr
acceptstrue
andfalse
as string values- add CSV functions for signed, unsigned and netip prefixes
- add
RetroKeys
option- Breaking change:
New
takeshandleDeprecatedKey
functional argument, which can be left to nil
- Breaking change:
- add
sources/merger
package with sources merger generic codevalidate
:- add
AreAllOneOfCaseInsensitive
function - add
FileExists
function - add
DirectoryExists
function - add
ListeningAddress
function
- add
- Breaking changes:
- Change
MergeWith
to be a value receiver and return a merged result sources/env
:- all functions changed to methods on
Env
which is created withenv.New(os.Environ())
Get
trims quotes by default- add environment variable key in the error context
Get
returns a string pointer, which is alwaysnil
if the variable is not set, and can benil
if empty values are not accepted (default). Most functions still returnnil
if they get an empty string (i.e.Uint8Ptr
)
- all functions changed to methods on
- Change
Fixes
sources/env
: trim both spaces and new lines if both are specifiedvalidate
: fixorStrings
functionMergeWithSlice
with nil arguments
Documentation
- Readme: update features section
- Readme: fully revised
- Readme: add gluetun, dns and tinier as concrete examples
- Add comments to all exported members
- Add
examples/merger/main.go
- Add
Names
string slice field to example settings inexample/settings/settings.go
sources/env
:- document
Get
default behavior - add
Test_New
test
- document
Maintenance
- Drop dependency on
github.com/qdm12/govalid
:sources/env
: add unsigned and signed local parse functionssources/env
: package localparseBool
sources/env
:- split
Get
body intopostProcessValue
function Get
has a more flexible value trimming logic
- split
- Enforce exported comments with linter, except for sentinel errors
v0.3.0-rc14
Documentation
sources/env
: comment on order of retro keys
Features
sources/env
: addDuration
method
v0.3.0-rc13
Features
sources/env
: addUint32Ptr
sources/env
:BoolPtr
accepts true and false as string valuessources/env
: add CSV functions for signed, unsigned and netip prefixessources/env
: addRetroKeys
option- Breaking change:
New
takeshandleDeprecatedKey
functional argument, which can be left to nil
- Breaking change:
Maintenance
- Drop dependency on qdm12/govalid:
sources/env
: add unsigned and signed local parse functionssources/env
: package localparseBool
v0.3.0-rc12
- Fix: MergeWithSlice with nil arguments
- Maintenance: sources/env: add
Test_New
test
v0.3.0-rc11
change(sources/env): all functions changed to methods on `Env`
v0.3.0-rc10
fix(validate): `orStrings` function