config

package
v0.0.0-...-7fde5a9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFile = "smeter.yml"

ConfigFile is the file name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Port string `yaml:"port"`
		Host string `yaml:"host"`
		SSL  bool   `yaml:"ssl"`
		CA   string `yaml:"ca"`
		KEY  string `yaml:"key"`
	}
	Database struct {
		Port     string `yaml:"port"`
		Host     string `yaml:"host"`
		UserName string `yaml:"username"`
		Password string `yaml:"password"`
		DBName   string `yaml:"db"`
		SSL      bool   `yaml:"ssl"`
	}
}

Config structure

func NewConfig

func NewConfig() *Config

NewConfig returns the default config.

func (*Config) Load

func (c *Config) Load(filename string) error

Load reads config file and unmarshal it to the structure.

func (*Config) Write

func (c *Config) Write(filename string) error

Write takes the config structure, marshal and write it to file.

Jump to

Keyboard shortcuts

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