options

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionBlock = "connection"
	DatabaseBlock   = "database"
	GeneralBlock    = "general"
	TerminalBlock   = "terminal"
)

hcl options block types

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Cache    *bool `hcl:"cache"`
	CacheTTL *int  `hcl:"cache_ttl"`
}

options.Connection

func (*Connection) ConfigMap

func (c *Connection) ConfigMap() map[string]interface{}

func (*Connection) Equals

func (c *Connection) Equals(other *Connection) bool

func (*Connection) Merge added in v0.4.0

func (c *Connection) Merge(otherOptions Options)

merge other options over the the top of this options object i.e. if a property is set in otherOptions, it takes precedence

func (*Connection) String added in v0.4.0

func (c *Connection) String() string

type Database

type Database struct {
	Port       *int    `hcl:"port"`
	Listen     *string `hcl:"listen"`
	SearchPath *string `hcl:"search_path"`
}

Database

func (*Database) ConfigMap

func (d *Database) ConfigMap() map[string]interface{}

ConfigMap :: create a config map to pass to viper

func (*Database) Merge added in v0.4.0

func (d *Database) Merge(otherOptions Options)

Merge :: merge other options over the the top of this options object i.e. if a property is set in otherOptions, it takes precedence

func (*Database) String added in v0.4.0

func (d *Database) String() string

type General

type General struct {
	UpdateCheck *string `hcl:"update_check"`
}

General

func (*General) ConfigMap

func (g *General) ConfigMap() map[string]interface{}

ConfigMap :: create a config map to pass to viper

func (*General) Merge added in v0.4.0

func (g *General) Merge(otherOptions Options)

Merge :: merge other options over the the top of this options object i.e. if a property is set in otherOptions, it takes precedence

func (*General) String added in v0.4.0

func (g *General) String() string

type Options

type Options interface {
	// map of config keys to values - used to populate viper
	ConfigMap() map[string]interface{}
	// merge with another options of same type
	Merge(otherOptions Options)
}

type Terminal

type Terminal struct {
	Output           *string `hcl:"output"`
	Separator        *string `hcl:"separator"`
	Header           *bool   `hcl:"header"`
	Multi            *bool   `hcl:"multi"`
	Timing           *bool   `hcl:"timing"`
	SearchPath       *string `hcl:"search_path"`
	SearchPathPrefix *string `hcl:"search_path_prefix"`
	Watch            *bool   `hcl:"watch"`
}

Terminal

func (*Terminal) ConfigMap

func (t *Terminal) ConfigMap() map[string]interface{}

ConfigMap :: create a config map to pass to viper

func (*Terminal) Merge added in v0.4.0

func (t *Terminal) Merge(otherOptions Options)

merge other options over the the top of this options object i.e. if a property is set in otherOptions, it takes precedence

func (*Terminal) String added in v0.4.0

func (t *Terminal) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL