This PR introduces a new TagLoader struct that satisfies the Loader interface. This is pluggable so people can use with other loaders to create their own custom multi loaders. However for our DefaultLoader its enabled by default. The DefaultLoader is now a multi loader which loads in the order of
Values from each field's tag's defined by the default key. Example:
Name string `default:"koding"`
From a file if constructed with NewWithPath() or without a file if constructed with New()
From environment variables
From flag variables.
The tag key name default can be changed if wished and configurable. I also improved the examples so each example is self contained (showing the struct itself) and introduced a new example for DefaultLoader
This PR introduces a new
TagLoader
struct that satisfies theLoader
interface. This is pluggable so people can use with other loaders to create their own custom multi loaders. However for ourDefaultLoader
its enabled by default. TheDefaultLoader
is now a multi loader which loads in the order ofdefault
key. Example:NewWithPath()
or without a file if constructed withNew()
The tag key name
default
can be changed if wished and configurable. I also improved the examples so each example is self contained (showing the struct itself) and introduced a new example forDefaultLoader