mirror of
https://github.com/turbot/steampipe.git
synced 2026-05-22 19:00:59 -04:00
26 lines
563 B
Go
26 lines
563 B
Go
package options
|
|
|
|
import "github.com/turbot/steampipe/constants"
|
|
|
|
// Database
|
|
type Database struct {
|
|
Port *int `hcl:"database-port"`
|
|
Listen *string `hcl:"database-listen"`
|
|
}
|
|
|
|
// Populate :: nothing to do
|
|
func (d Database) Populate() {}
|
|
|
|
// ConfigMap :: create a config map to pass to viper
|
|
func (c *Database) ConfigMap() map[string]interface{} {
|
|
// only add keys which are non null
|
|
res := map[string]interface{}{}
|
|
if c.Port != nil {
|
|
res[constants.ArgPort] = c.Port
|
|
}
|
|
if c.Listen != nil {
|
|
res[constants.ArgListenAddress] = c.Listen
|
|
}
|
|
return res
|
|
}
|