config

package
v0.0.0-...-7f34ccf Latest Latest
Warning

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

Go to latest
Published: Jan 23, 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    `mapstructure:"server" json:"server"`
	Debug    DebugC     `mapstructure:"debug" json:"debug"`
	SQLite   SQLiteC    `mapstructure:"sqlite" json:"sqlite"`
	P2P      P2PS       `mapstructure:"p2p" json:"p2p"`
	UserList []UserInfo `mapstructure:"userlist" json:"userlist"`
}

func Get

func Get() *Config

type DebugC

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

type P2PS

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

type SQLiteC

type SQLiteC struct {
	Filename string `mapstructure:"filename" json:"filename"`
}

type ServerC

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

type UserInfo

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳