config

package
v0.0.0-...-dc0fecf Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loadsetting

func Loadsetting()

func SaveNetworkSetting

func SaveNetworkSetting(ip string, mask string, gateway string, tbserver string) error

func SavePasswd

func SavePasswd(passwd string) error

func Set

func Set(c Config)

Set sets the configuration.

Types

type Config

type Config struct {
	General struct {
		LogLevel                  int    `mapstructure:"log_level"`
		LogToSyslog               bool   `mapstructure:"log_to_syslog"`
		PasswordHashIterations    int    `mapstructure:"password_hash_iterations"`
		GRPCDefaultResolverScheme string `mapstructure:"grpc_default_resolver_scheme"`
		DSN                       string `mapstructure:"dsn"`
		TtsPath                   string `mapstructure:"ttspath"`
		TtsApiKey                 string `mapstructure:"ttsapikey"`
		TtsSecretKey              string `mapstructure:"ttssecretkey"`
		UpdateCheckURL            string `mapstructure:"updatecheckurl"`
	} `mapstructure:"general"`
	ExternalAPI struct {
		Bind       string `mapstructure:"bind"`
		Secret     string `mapstructure:"secret"`
		User       string `mapstructure:"user"`
		Passwd     string `mapstructure:"passwd"`
		NetIp      string `mapstructure:"netip"`
		NetMask    string `mapstructure:"netmask"`
		NetGateway string `mapstructure:"netgateway"`
		UdpPort    uint32 `mapstructure:"udpport"`
	} `mapstructure:"external_api"`
	ControllerProxy struct {
		Ip          string `mapstructure:"ip"`
		Port        int32  `mapstructure:"port"`
		Token       string `mapstructure:"token"`
		ServicePath string `mapstructure:"service_path"`
	} `mapstructure:"controller_proxy"`
	ComserverProxy struct {
		Ip          string `mapstructure:"ip"`
		Port        int32  `mapstructure:"port"`
		Token       string `mapstructure:"token"`
		ServicePath string `mapstructure:"service_path"`
	} `mapstructure:"comserver_proxy"`
}
var Conf Config

C holds the global configuration.

func Get

func Get() *Config

Get returns the configuration.

func (*Config) GetUser

func (c *Config) GetUser() (userName string, passWd string, err error)

func (*Config) ReadJwtSecret

func (c *Config) ReadJwtSecret() (secret string, err error)

Jump to

Keyboard shortcuts

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