config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRenderedConfFromFile

func GetRenderedConfFromFile(path string) (out string, err error)

func LoadAllCatalogFromIni

func LoadAllCatalogFromIni(content string) (catalogs map[string]*CatalogConf, err error)

func ParseIgnoreRegexp

func ParseIgnoreRegexp(ignore string) []string

func ParseIgnoreSuffix

func ParseIgnoreSuffix(ignore string) []string

func ReaderContent

func ReaderContent(in string) (out string, err error)

Types

type CatalogConf

type CatalogConf struct {
	Name          string   `json:"name"`
	Path          string   `json:"path"`
	IgnoreSuffixs []string `json:"ignore_suffix"`
	IgnoreRegexp  []string `json:"ignore_regexp"`
	ChildFile     []string `json:"child_file"`
}

func (*CatalogConf) Check

func (cf *CatalogConf) Check() (err error)

func (*CatalogConf) FullFilePath

func (cf *CatalogConf) FullFilePath(filePath string) string

func (*CatalogConf) HasChildFile

func (cf *CatalogConf) HasChildFile(childfile string) (ok bool)

type ServerCommonConf

type ServerCommonConf struct {
	BindAddr string `json:"bind_addr"`
	BindPort int    `json:"bind_port"`
	// time unit minute
	ConnMaxTime time.Duration `json:"con_max_time"`
	// time unit second
	HeartInterval  time.Duration `json:"heart_interval"`
	LogFile        string        `json:"log_file"`
	LogLevel       string        `json:"log_level"`
	LogWay         string        `json:"log_way"`
	LogMaxDays     int64         `json:"log_max_days"`
	User           string        `json:"user"`
	Pwd            string        `json:"pwd"`
	IgnoreSuffix   []string      `json:"ignore_suffix"`
	IgnoreRegexp   []string      `json:"ignore_regexp"`
	LastReadOffset int64         `json:"last_read_offset"`
	AssetsDir      string        `json:"assets_dir"`
}

func GetDefaultServerConf

func GetDefaultServerConf() *ServerCommonConf

func UnmarshalServerConfFromIni

func UnmarshalServerConfFromIni(defaultCfg *ServerCommonConf, content string) (cfg *ServerCommonConf, err error)

func (*ServerCommonConf) Check

func (cfg *ServerCommonConf) Check() (err error)

type Values

type Values struct {
	Envs map[string]string
}

func GetValues

func GetValues() *Values

Jump to

Keyboard shortcuts

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