config

package
v0.0.0-...-80a2c53 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppOptions = ProgramOptions{
		LogLevel: log.InfoLevel,
	}
)

package variables for config

Functions

This section is empty.

Types

type Config

type Config struct {
	Database struct {
		Host     string
		Name     string
		User     string
		Password string
		Port     int
	}
	Options struct {
		LogLevel      string `yaml:"logLevel"`
		SSHPrivateKey string `yaml:"sshPrivateKey"`
	}

	Listeners []struct {
		Address     string
		Port        uint16
		Protocol    string
		ConvertUTF8 bool `yaml:"convertUTF8"`
	}
	Prometheus struct {
		Enabled bool
		Address string
		Port    uint16
		Path    string
	}
}

structure used for the yaml parsing

type ConnectionType

type ConnectionType int
const (
	TCPTelnet ConnectionType = iota
	TCPRaw
	TCPSSH
)

func (ConnectionType) String

func (t ConnectionType) String() (result string)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     uint16
	Database string
	User     string
	Password string
}

final structure for db config

type Listener

type Listener struct {
	Address     string
	Port        uint16
	ListenType  ConnectionType
	ConvertUTF8 bool
}

final structure for listener config

func ParseConfig

func ParseConfig(configFile string) ([]Listener, error)

type ProgramOptions

type ProgramOptions struct {
	LogLevel      log.Level
	SSHPrivateKey string
	Prometheus    PrometheusConfig
}

final structure for program options

type PrometheusConfig

type PrometheusConfig struct {
	Enabled bool
	Address string
	Port    uint16
	Path    string
}

final structure for prometheus endpoint

Jump to

Keyboard shortcuts

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