cfgargs

package
v0.0.0-...-b87ab60 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRedisAddr

func GetRedisAddr(config *SrvConfig) string

GetRedisAddr printf the redis addr from srvconfig

Types

type Build

type Build struct {
	BuildTime    string
	BuildUser    string
	BuildVersion string
	BuildMachine string
}

type Gate

type Gate struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
	Mode string `yaml:"mode"`
	// 初始化Mode模式的Broker失败是否panic
	Panic bool `yaml:"panic"`
}

Gate configure for Gate Node.

type HTTP

type HTTP struct {
	Cors    bool   `yaml:"cors"`
	Port    string `yaml:"port"`
	Release bool   `yaml:"release"`
	Sign    bool   `yaml:"sign"`
}

type Log

type Log struct {
	Level   string `yaml:"level"`
	Console bool   `yaml:"console"`
	Path    string `yaml:"path"`
	Sync    bool   `yaml:"sync"`
}

type Logic

type Logic struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
	Mode string `yaml:"mode"`
	// 初始化Mode模式的Broker失败是否panic
	Panic bool `yaml:"panic"`
}

Logic configure for Logic Server

type Mongo

type Mongo struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	DB       string `yaml:"db"`
	Password string `yaml:"password"`
	Panic    bool   `yaml:"panic"`
}

Mongo conf for mongoDB

type Redis

type Redis struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
	Panic    bool   `yaml:"panic"`
}

Redis configure for Redis

type SocketIO

type SocketIO struct {
	Port int  `yaml:"port"`
	Cors bool `yaml:"cors"`
}

type SrvConfig

type SrvConfig struct {
	Build
	Mongo    `yaml:"mongo" json:"Mongo,omitempty"`
	Redis    `yaml:"redis" json:"Redis,omitempty"`
	Log      `yaml:"log" json:"Log,omitempty"`
	HTTP     `yaml:"http" json:"HTTP,omitempty"`
	SocketIO `yaml:"socket.io" json:"SocketIO,omitempty"`
	Logic    `yaml:"logic" json:"Logic,omitempty"`
	Gate     `yaml:"gate" json:"Gate,omitempty"`
	AppKey   string `yaml:"appkey" json:"AppKey"`
}

SrvConfig records for all conf

func GetLastSrvConfig

func GetLastSrvConfig() *SrvConfig

GetLastSrvConfig 返回全局

func InitSrvCfg

func InitSrvCfg(build *Build, flagParse func()) (*SrvConfig, error)

func (*SrvConfig) Print

func (s *SrvConfig) Print()

Jump to

Keyboard shortcuts

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