config

package
v0.0.0-...-5679b30 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides configuration management for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(configPath string) error

Load 从指定路径加载配置文件到全局单例.

Types

type Config

type Config struct {
	Server ServerConfig `mapstructure:"server"`
}

Config 应用配置.

func Get

func Get() *Config

Get 获取全局配置实例.

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

ServerConfig 服务器配置.

func (*ServerConfig) Address

func (s *ServerConfig) Address() string

Address 返回服务器地址.

Jump to

Keyboard shortcuts

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