config

package
v0.0.0-...-a9bd8d8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(writer io.Writer, cfg *AutoGenerated) error

Types

type AutoGenerated

type AutoGenerated struct {
	Project struct {
		Install  []string `toml:"install"`
		LoppTime int      `toml:"lopp_time"`
		Log      struct {
			AccessLog string `toml:"access_log"`
			ErrorLog  string `toml:"error_log"`
		} `toml:"log"`
	} `toml:"project"`
	Plugin map[string]map[string]map[string]interface{} `toml:"plugin"`
	// contains filtered or unexported fields
}

func Read

func Read(reader io.Reader) *AutoGenerated

Read 从io.Reader中读取数据并序列化为Toml Struct 定义了一些转义的指令,遇到匹配的指令会转义

Example:
$ENV:GOPATH,$env:GOPATH
会被转义为从进程环境变量中读取GOPATH对应的值并替换

func (*AutoGenerated) PluginGetData

func (a *AutoGenerated) PluginGetData(key string) interface{}

func (*AutoGenerated) RangePluginData

func (a *AutoGenerated) RangePluginData(fn func(k string, v interface{}))

RangePluginData 遍历插件的配置

func (*AutoGenerated) SetPluginName

func (a *AutoGenerated) SetPluginName(name string)

func (*AutoGenerated) SetPluginScope

func (a *AutoGenerated) SetPluginScope(scope string)

Jump to

Keyboard shortcuts

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