config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common struct {
	IntrospectURL string `yaml:"introspect_url" envconfig:"BACKEND_INTROSPECT_URL"`
}

func (*Common) Init

func (x *Common) Init()

type Config

type Config struct {
	MQTT     MQTT   `yaml:"mqtt"`
	MySQL    MySQL  `yaml:"mysql"`
	Influx   Influx `yaml:"influx"`
	Settings Local  `yaml:"settings"`
	Common   Common `yaml:"common"`
}

Config : structure to hold configuration

func GetConfig

func GetConfig() *Config

GetConfig : get config file

func (*Config) Init

func (x *Config) Init()

type Influx

type Influx struct {
	URL    string `yaml:"url" envconfig:"INFLUXDB_URL"`
	ORG    string `yaml:"org" envconfig:"INFLUXDB_ORG"`
	BUCKET string `yaml:"bucket" envconfig:"INFLUXDB_BUCKET"`
	TOKEN  string `yaml:"token" envconfig:"INFLUXDB_TOKEN"`
}

func (*Influx) Init

func (x *Influx) Init()

type Local

type Local struct {
	Address          string `yaml:"bind_address" envconfig:"CONTROLLER_BIND_ADDRESS"`
	Port             uint   `yaml:"bind_port" envconfig:"CONTROLLER_BIND_PORT"`
	LogLevel         int    `yaml:"loglevel"  envconfig:"CONTROLLER_LOGLEVEL"`
	ExtensionStorage string `yaml:"storage"  envconfig:"CONTROLLER_STORAGE"`
}

func (*Local) Init

func (x *Local) Init()

type MQTT

type MQTT struct {
	HOST     string `yaml:"host" envconfig:"MQTT_BROKER_HOST"`
	PORT     uint   `yaml:"port" envconfig:"MQTT_BROKER_PORT"`
	USER     string `yaml:"user" envconfig:"MQTT_BROKER_USER"`
	PASSWORD string `yaml:"password" envconfig:"MQTT_BROKER_PASSWORD"`
}

MQTT : structure to hold configuration

func (*MQTT) Init

func (x *MQTT) Init()

type MySQL

type MySQL struct {
	DATABASE string `yaml:"database" envconfig:"DB_DATABASE"`
	HOST     string `yaml:"host" envconfig:"DB_HOST"`
	PORT     uint   `yaml:"port" envconfig:"DB_PORT"`
	USERNAME string `yaml:"username" envconfig:"DB_USERNAME"`
	PASSWORD string `yaml:"password" envconfig:"DB_PASSWORD"`
}

func (*MySQL) GenConfig

func (x *MySQL) GenConfig() *mysql.Config

func (*MySQL) Init

func (x *MySQL) Init()

type World

type World struct {
	Kind       string               `json:"kind"`
	Spaces     map[string]uuid.UUID `json:"spaces"`
	SpaceTypes map[string]uuid.UUID `json:"space_types"`
	Effects    map[string]uuid.UUID `json:"effects"`
}

Jump to

Keyboard shortcuts

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