config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnv

func ParseEnv(s string) *map[string]string

func ParseIni

func ParseIni(data []byte) (res map[string]interface{}, err error)

Types

type Config

type Config struct {
	ProgramGroup *ProcessGroup
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(configFile string) *Config

func (*Config) GetConfigFileDir

func (that *Config) GetConfigFileDir() string

func (*Config) GetEntries

func (that *Config) GetEntries(filterFunc func(entry *Entry) bool) []*Entry

GetEntries 获取栏目

func (*Config) GetPrograms

func (that *Config) GetPrograms() []*Entry

GetPrograms 获取可执行程序

func (*Config) Load

func (that *Config) Load() error

type Entry

type Entry struct {
	Name  string
	Group string
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(name string, data *gmap.StrAnyMap, configFile string, entryType string) *Entry

NewEntry 创建配置文件条目

func (*Entry) Get

func (that *Entry) Get(key string) *gvar.Var

func (*Entry) IsProgram

func (that *Entry) IsProgram() bool

func (*Entry) Map

func (that *Entry) Map() *gmap.StrAnyMap

func (*Entry) Set

func (that *Entry) Set(key string, val interface{})

func (*Entry) String

func (that *Entry) String() string

type ProcessGroup

type ProcessGroup struct {
	// contains filtered or unexported fields
}

func NewProcessGroup

func NewProcessGroup() *ProcessGroup

func (*ProcessGroup) Add

func (that *ProcessGroup) Add(group string, procName string)

func (*ProcessGroup) Clone

func (that *ProcessGroup) Clone() *ProcessGroup

func (*ProcessGroup) ForEachProcess

func (that *ProcessGroup) ForEachProcess(procFunc func(group string, procName string))

func (*ProcessGroup) GetAllGroup

func (that *ProcessGroup) GetAllGroup() []string

func (*ProcessGroup) GetAllProcess

func (that *ProcessGroup) GetAllProcess(group string) []string

func (*ProcessGroup) GetGroup

func (that *ProcessGroup) GetGroup(procName string, defGroup string) string

func (*ProcessGroup) InGroup

func (that *ProcessGroup) InGroup(procName string, group string) bool

func (*ProcessGroup) Remove

func (that *ProcessGroup) Remove(procName string)

func (*ProcessGroup) String

func (that *ProcessGroup) String() string

type ProcessNameExpression

type ProcessNameExpression struct {
	// contains filtered or unexported fields
}

func NewProcessNameExpression

func NewProcessNameExpression(envs ...map[string]interface{}) *ProcessNameExpression

NewProcessNameExpression 创建 变量池子

func (*ProcessNameExpression) Add

Add 添加变量

func (*ProcessNameExpression) Eval

func (that *ProcessNameExpression) Eval(s string) (string, error)

Eval 执行变量替换

Jump to

Keyboard shortcuts

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