Documentation ¶
Overview ¶
Package confix applies changes to a Tendermint TOML configuration file, to update configurations created with an older version of Tendermint to a compatible format for a newer version.
Index ¶
- func ApplyFixes(ctx context.Context, doc *tomledit.Document) error
- func CheckValid(data []byte) error
- func GuessConfigVersion(doc *tomledit.Document) string
- func LoadConfig(path string) (*tomledit.Document, error)
- func Upgrade(ctx context.Context, configPath, outputPath string) error
- func WithLogWriter(ctx context.Context, w io.Writer) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFixes ¶
ApplyFixes transforms doc and reports whether it succeeded.
func CheckValid ¶
CheckValid checks whether the specified config appears to be a valid Tendermint config file. This emulates how the node loads the config.
func GuessConfigVersion ¶
GuessConfigVersion attempts to figure out which version of Tendermint created the specified config document. It returns "" if the creating version cannot be determined, otherwise a string of the form "vX.YY".
func LoadConfig ¶
LoadConfig loads and parses the TOML document from path.
func Upgrade ¶
Upgrade reads the configuration file at configPath and applies any transformations necessary to upgrade it to the current version. If this succeeds, the transformed output is written to outputPath. As a special case, if outputPath == "" the output is written to stdout.
It is safe if outputPath == inputPath. If a regular file outputPath already exists, it is overwritten. In case of error, the output is not written.
Upgrade is a convenience wrapper for calls to LoadConfig, ApplyFixes, and CheckValid. If the caller requires more control over the behavior of the upgrade, call those functions directly.
Types ¶
This section is empty.