config

package
v0.0.0-...-eba1a7b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunningDir  = osxu.GetRunningDir()
	BaseLogPath = osxu.GetRunningDir() + "/log"
)

Functions

This section is empty.

Types

type ModuleConfig

type ModuleConfig struct {
	Socks  []SockConf   `json:"socks,omitempty"`
	Routes []ObjectConf `json:"routes,omitempty"`
	Admins []ObjectConf `json:"admins,omitempty"`
	Games  []ObjectConf `json:"games,omitempty"`
	OnList []string     `json:"onList"`
	// contains filtered or unexported fields
}
var DefaultModuleConfig *ModuleConfig

func ParseModuleConfig

func ParseModuleConfig(flagSet *cmdx.FlagSetExtend) *ModuleConfig

func ParseModuleConfigByContent

func ParseModuleConfigByContent(content []byte) *ModuleConfig

func ParseModuleConfigByPath

func ParseModuleConfigByPath(path string) *ModuleConfig

func (*ModuleConfig) GetObjectById

func (c *ModuleConfig) GetObjectById(id string) (ObjectConf, bool)

func (*ModuleConfig) GetServiceConf

func (c *ModuleConfig) GetServiceConf(name string) (SockConf, bool)

type ObjectConf

type ObjectConf struct {
	Id         string   `json:"id"`
	ModuleName string   `json:"module"`
	RpcList    []string `json:"rpc,omitempty"`
	SockList   []string `json:"socks,omitempty"`
	Remotes    []string `json:"remotes,omitempty"`
	Log        string   `json:"log,omitempty"`
	// contains filtered or unexported fields
}

func GetObjectById

func GetObjectById(name string) (ObjectConf, bool)

func (ObjectConf) GetServiceConf

func (c ObjectConf) GetServiceConf(name string) (SockConf, bool)

func (ObjectConf) LogFileInfo

func (oc ObjectConf) LogFileInfo() (fileDir string, fileBaseName string, fileExtName string)

type SockConf

type SockConf struct {
	Name    string `json:"name"`
	Network string `json:"network"`
	Addr    string `json:"addr"`
}

func GetServiceConf

func GetServiceConf(name string) (SockConf, bool)

Jump to

Keyboard shortcuts

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