config

package
Version: v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(conf *Config, filename string) (err error)

Save 将配置信息序列化成JSON并写到指定磁盘位置

Types

type Config

type Config struct {
	Version    string     `json:"version"`              // 版本号
	Tool       string     `json:"tool"`                 // 编译工具:go、gb...
	Importpath string     `json:"importpath,omitempty"` // 待替换的变量所在包导入路径,如github.com/voidint/gbb/build
	Variables  []Variable `json:"variables,omitempty"`  // 待替换变量集合
	Debug      bool       `json:"-"`
	All        bool       `json:"-"`
}

Config 配置结构体

func Load

func Load(filename string) (conf *Config, err error)

Load 从磁盘文件加载配置信息

type Variable

type Variable struct {
	Variable string `json:"variable"`
	Value    string `json:"value"`
}

Variable 变量结构体

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL