config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

we store config seperately from terminus to prevent circular dependency errors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// directory to store accounts in
	AccountPersistDir string
	ListenConfig      ListenConfig
	RpcConfig         RpcConfig
}

config for terminus

func NewConfig

func NewConfig() *Config

create a new terminus config

func ParseConfig

func ParseConfig(fileContents string) (config Config, err error)

func ParseConfigFromFile

func ParseConfigFromFile(filePath string) (conf Config, err error)

func (*Config) GetAccountPersistDir

func (c *Config) GetAccountPersistDir() string

func (*Config) GetAddress

func (c *Config) GetAddress() string

func (*Config) GetBindHost

func (c *Config) GetBindHost() string

Default listening bind setting. 127.0.0.1 for localhost connections, 0.0.0.0 for allowing connections from other hosts

func (*Config) GetBindPort

func (c *Config) GetBindPort() int

port to listen for websocket connections

func (*Config) GetCertChainFile

func (c *Config) GetCertChainFile() string

ssl certificate file

func (*Config) GetCertFile

func (c *Config) GetCertFile() string

ssl certificate file

func (*Config) GetExternalHost

func (c *Config) GetExternalHost() string

host for other devices to connect via the beacon

func (*Config) GetExternalPort

func (c *Config) GetExternalPort() int

host for other devices to connect via the beacon

func (*Config) GetHostName

func (c *Config) GetHostName() string

get host:port

func (*Config) GetKeyFile

func (c *Config) GetKeyFile() string

ssl certificate file

func (*Config) GetRelayUrl

func (c *Config) GetRelayUrl() string

func (*Config) GetRpcAddress

func (c *Config) GetRpcAddress() string

func (*Config) GetRpcHostname

func (c *Config) GetRpcHostname() string

func (*Config) GetSelfSignedCert

func (c *Config) GetSelfSignedCert() bool

ssl certificate file

func (*Config) GetUseTls

func (c *Config) GetUseTls() bool

wether or not to use tls

func (*Config) RpcServerTimeout

func (c *Config) RpcServerTimeout() time.Duration

func (Config) Validate

func (c Config) Validate() error

type ListenConfig

type ListenConfig struct {
	// Default listening bind setting. 127.0.0.1 for localhost connections, 0.0.0.0
	// for allowing connections from other hosts
	BindHost string
	// default port to listen for websocket connections port not specified.
	BindPort int
	//  host for other devices to connect via the beacon
	ExternalHost string
	// port for other devices to connect via the beacon
	ExternalPort int
	// contains filtered or unexported fields
}

ListenConfig specifies the configuration for terminus to listen on

func (ListenConfig) Validate

func (l ListenConfig) Validate() error

validate the configuration

type RpcConfig

type RpcConfig struct {
	// host for client to connect
	BindHost string
	// port for client to connect
	BindPort int
	// host for a client to connect
	ExternalHost string
	// port for client to connect
	ExternalPort int
}

func (RpcConfig) Validate

func (l RpcConfig) Validate() error

type Section

type Section struct {
	// contains filtered or unexported fields
}

func NewSection

func NewSection(name string, cfg *goconfigparser.ConfigParser) Section

create a new section object that reads from a a section of the config

func (Section) GetBool

func (s Section) GetBool(option string) bool

func (Section) GetInt

func (s Section) GetInt(option string) int

func (Section) GetString

func (s Section) GetString(option string) string

get a string from the config section handles python None types

Jump to

Keyboard shortcuts

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