config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const EnvPrefix = "AM"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB DBConfig

	AMHost      string `default:"am-service"`
	AMPort      int    `default:"9120"`
	IMHost      string `default:"im-service"`
	IMPort      int    `default:"9119"`
	TlsEnabled  bool   `default:"false"`
	TlsCertFile string `default:"server.cert"`
	TlsKeyFile  string `default:"server.key"`
	LogLevel    string `default:"DEBUG"`
}

func Default

func Default() *Config

func Load

func Load(path string) (*Config, error)

func MustLoad

func MustLoad(path string) *Config

func (*Config) JSONString

func (m *Config) JSONString() string

func (*Config) TOMLString

func (m *Config) TOMLString() string

func (*Config) YAMLString

func (m *Config) YAMLString() string

type DBConfig

type DBConfig struct {
	Type          string `default:"mysql"`
	Host          string `default:"am-db"`
	Port          int    `default:"3306"`
	User          string `default:"root"`
	Password      string `default:"password"`
	Database      string `default:"am"`
	LogModeEnable bool   `default:"false"`
}

func (*DBConfig) GetHost

func (m *DBConfig) GetHost() string

func (*DBConfig) GetUrl

func (m *DBConfig) GetUrl() string

Jump to

Keyboard shortcuts

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