- Add properties to the
WorkspaceProfile
struct inpkg/steampipeconfig/modconfig/workspace_profile.go
. - Add
hcl
andcty
tags to the properties. (eample:hcl:"search_path" cty:"search_path"
). - Add to
(p *WorkspaceProfile) setBaseProperties()
. This enablesbase
profile inheritance. Remember to check fornil
. - Add to
(p *WorkspaceProfile) ConfigMap(commandName string)
.
Adding an options
property. Example Commit
type Query struct {}
// ConfigMap :: this is merged with viper
// Only add keys which are not nil
func (t *Query) ConfigMap() map[string]interface{} {}
// Merge :: merge other options over the top of this options object
// i.e. if a property is set in otherOptions, it takes precedence
func (t *Query) Merge(otherOptions Options) {
// make sure this is the type we want
if _, ok := otherOptions.(*Query); !ok {
return
}
}
// String serialize for printing
func (t *Query) String() string {}
For properties in the struct which need to be extracted from the HCL, add the following tag
hcl:"output"
where output
is the property in the HCL.