config

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(path string)

Types

type Config

type Config struct {
	Server   ServerC    `json:"server"`
	Debug    DebugC     `json:"debug"`
	Mysql    MysqlS     `json:"mysql"`
	UserList []UserInfo `json:"userlist"`
	P2P      P2PS       `json:"p2p"`
}

func Get

func Get() *Config

type DebugC

type DebugC struct {
	Enable bool `json:"enable"`
	Port   int  `json:"port"`
}

type MysqlS

type MysqlS struct {
	Addr         string `json:"addr"`
	User         string `json:"user"`
	Password     string `json:"password"`
	DBName       string `json:"dbname"`
	MinAlive     int    `json:"minAlive"`
	MaxAlive     int    `json:"maxAlive"`
	MaxIdle      int    `json:"maxIdle"`
	ReadonlyUser string `json:"readonlyUser"`
}

type P2PS

type P2PS struct {
	Enable              bool   `json:"enable"`
	ServiceDiscoveryID  string `json:"service_discovery_id"`
	ServiceCommandTopic string `json:"service_command_topic"`
	ServiceDiscoverMode string `json:"service_discover_mode"`
	NodeHostIP          string `json:"node_host_ip"`
	NodeHostPort        int    `json:"node_host_port"`
	AdminTopic          string `json:"admin_topic"`
	ReadonlyTopic       string `json:"readonly_topic"`
}

type ServerC

type ServerC struct {
	Addr string `json:"addr"`
}

type UserInfo

type UserInfo struct {
	User     string `json:"user"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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