config

package
v0.0.0-...-d8b0a59 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 0 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 NmqConfigFile = "nmq.yaml"

NmqConfigFile 配置文件名称(编译时常量)

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(log *zap.Logger) error

func SetGlobalConfig

func SetGlobalConfig(cfg Config)

SetGlobalConfig 设置全局配置(仅在初始化阶段调用)

Types

type Config

type Config struct {
	Network NetworkConfig `yaml:"network"`
}

func GetGlobalConfig

func GetGlobalConfig() *Config

GetGlobalConfig 获取全局配置(只读访问)

type NetworkConfig

type NetworkConfig struct {
	Webui ServiceConfig `yaml:"webui"`
}

func GetNetworkConfig

func GetNetworkConfig() *NetworkConfig

func (*NetworkConfig) GetWebuiConfig

func (c *NetworkConfig) GetWebuiConfig() *ServiceConfig

type ServiceConfig

type ServiceConfig struct {
	Name    string `yaml:"name"`
	Address string `yaml:"address"` // ip:port or domain:port or domain
	Port    int    `yaml:"port"`
}

func (*ServiceConfig) GetAddress

func (c *ServiceConfig) GetAddress() string

func (*ServiceConfig) GetName

func (c *ServiceConfig) GetName() string

func (*ServiceConfig) GetPort

func (c *ServiceConfig) GetPort() int

Directories

Path Synopsis
ext

Jump to

Keyboard shortcuts

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