dcrd/sampleconfig/README.md
Dave Collins a20782d6a4
sampleconfig: Use embed with external files.
This updates the sampleconfig package to make use of Go's embed
functionality introduced in Go 1.16 which is acceptable since the
containing module requires Go 1.19.

Embedded files are preferable because they bring the benefits of both
external files in the repository that are easier to work with for
external tools and the ability to access their content programmatically
without having to deal with the various issues typically brought about
by programmatically accessing external files.

Also, when this was last updated to change the exported variable for
dcrd's sample config file over to a function (so it can't be mutated and
the implementation details can be changed if needed), the case for
dcrctl was missed.  Moreover, the existence of both configs makes the
func name FileContents ambiguous.

Unfortunately, those things can't be changed now without causing a major
module version bump to the main dcrd module which we really want to
avoid.

So, in order to address those things without needing a major module
version bump, this deprecates the FileContents func and
DcrctlSampleConfig variable and introduces two new functions named Dcrd
and Dcrctl that return the respective embedded sample configs.
2023-09-18 03:32:50 -05:00

981 B

sampleconfig

Build Status ISC License Doc

Package sampleconfig provides functions that return the contents of sample configuration files for dcrd and dcrctl. This is provided for tools that perform automatic configuration and would like to ensure the generated configuration files not only include the specifically configured values, but also provides samples of other configuration options.

Installation and Updating

This package is part of the github.com/decred/dcrd module. Use the standard go tooling for working with modules to incorporate it.

License

Package sampleconfig is licensed under the copyfree ISC License.