Modify all custom types to enable custom YAML marshalling and unmarshalling #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For concourse/concourse#6434
With the epic for converting concourse to start up using a config file, we no longer use go-flags to unmarshal into these custom types but rather use yaml unmarshalling. This pr converts all the flags to have custom YAML unmarshallers.
I also added yaml marshalers because I want to support generating a config file from an existing configuration struct. This can be useful to help users migrate from deploying with flags to a config file, without needing users to write up a config file from scratch. It can also be helpful for giving users their most up-to-date configuration field values.
Lastly, this commit also adds support for three methods,
Set
,String
andType
making it conform to thepflags.Value
interface https://pkg.go.dev/github.com/spf13/pflag?utm_source=godoc#Value. These are used by cobra in order to support a custom type being used in parsing flags. Once we fully deprecate flags, we can delete these methods.