options

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ServerBlock     = "server"
	ConnectionBlock = "connection"
	QueryBlock      = "query"
	CheckBlock      = "check"
	DashboardBlock  = "dashboard"
	DatabaseBlock   = "database"
	GeneralBlock    = "general"
	TerminalBlock   = "terminal"
	PluginBlock     = "plugin"
)

hcl options block types

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Output    *string `hcl:"output" cty:"check_output"`
	Separator *string `hcl:"separator" cty:"check_separator"`
	Header    *bool   `hcl:"header" cty:"check_header"`
	Timing    *bool   `hcl:"timing" cty:"check_timing"`
}

General

func (*Check) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*Check) Merge

func (t *Check) 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 (*Check) SetBaseProperties

func (t *Check) SetBaseProperties(otherOptions Options)

func (*Check) String

func (t *Check) String() string

type Connection

type Connection struct {
	Cache    *bool `hcl:"cache" json:"cache,omitempty"`
	CacheTTL *int  `hcl:"cache_ttl" json:"cache_ttl,omitempty"`

	// legacy properties included for backwards compatibility with v0.13
	LegacyCache    *bool `json:"Cache,omitempty"`
	LegacyCacheTTL *int  `json:"CacheTTL,omitempty"`
}

Connection is a struct representing connection options json tags needed as this is stored in the connection state file

func (*Connection) ConfigMap

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

func (*Connection) Equals

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

func (*Connection) Merge

func (c *Connection) Merge(otherOptions Options)

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

func (*Connection) MigrateLegacy

func (c *Connection) MigrateLegacy()

MigrateLegacy migrates the legacy properties into new properties

func (*Connection) String

func (c *Connection) String() string

type Database

type Database struct {
	Cache            *bool   `hcl:"cache"`
	CacheMaxTtl      *int    `hcl:"cache_max_ttl"`
	CacheMaxSizeMb   *int    `hcl:"cache_max_size_mb"`
	Listen           *string `hcl:"listen"`
	Port             *int    `hcl:"port"`
	SearchPath       *string `hcl:"search_path"`
	SearchPathPrefix *string `hcl:"search_path_prefix"`
	StartTimeout     *int    `hcl:"start_timeout"`
}

func (*Database) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*Database) Merge

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

func (d *Database) String() string

type General

type General struct {
	UpdateCheck *string `hcl:"update_check" cty:"update_check"`
	MaxParallel *int    `hcl:"max_parallel" cty:"max_parallel"`
	Telemetry   *string `hcl:"telemetry" cty:"telemetry"`
	LogLevel    *string `hcl:"log_level" cty:"log_level"`
	MemoryMaxMb *int    `hcl:"memory_max_mb" cty:"memory_max_mb"`
}

func (*General) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*General) Merge

func (g *General) Merge(otherOptions Options)

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

func (*General) SetBaseProperties

func (s *General) SetBaseProperties(otherOptions Options)

TODO KAI what is the difference between merge and SetBaseProperties

func (*General) String

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 Plugin

type Plugin struct {
	MemoryMaxMb *int `hcl:"memory_max_mb"`
}

func (*Plugin) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*Plugin) Merge

func (t *Plugin) Merge(otherOptions Options)

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

func (*Plugin) String

func (t *Plugin) String() string

type Query

type Query struct {
	Output       *string `hcl:"output" cty:"query_output"`
	Separator    *string `hcl:"separator" cty:"query_separator"`
	Header       *bool   `hcl:"header" cty:"query_header"`
	Multi        *bool   `hcl:"multi" cty:"query_multi"`
	Timing       *bool   `hcl:"timing" cty:"query_timing"`
	AutoComplete *bool   `hcl:"autocomplete" cty:"query_autocomplete"`
}

General

func (*Query) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*Query) Merge

func (t *Query) 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 (*Query) SetBaseProperties

func (t *Query) SetBaseProperties(otherOptions Options)

func (*Query) String

func (t *Query) String() string

type Server

type Server struct {
	Port   *int    `hcl:"port" cty:"port"`
	Listen *string `hcl:"listen" cty:"port"`
}

TODO KAI this is Flowpipe specific - should it be named as such

func (*Server) ConfigMap

func (s *Server) ConfigMap() map[string]interface{}

ConfigMap creates a config map that can be merged with viper

func (*Server) Merge

func (s *Server) Merge(otherOptions Options)

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

func (*Server) SetBaseProperties

func (s *Server) SetBaseProperties(otherOptions Options)

TODO KAI what is the difference between merge and SetBaseProperties

func (*Server) String

func (s *Server) String() string

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"`
	AutoComplete     *bool   `hcl:"autocomplete"`
}

func (*Terminal) ConfigMap

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

ConfigMap creates a config map that can be merged with viper

func (*Terminal) Merge

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

func (t *Terminal) String() string

Jump to

Keyboard shortcuts

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