config

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package config 管理配置文件的相关功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(wd string, recursive bool) error

Write 根据 wd 所在目录的内容生成一个配置文件,并写入到该目录配置文件中。

wd 表示当前程序的工作目录,根据此目录的内容检测其语言特性。

Types

type Config

type Config struct {
	// 产生此配置文件的程序版本号
	//
	// 程序会用此来判断程序的兼容性。
	Version string `yaml:"version"`

	// 输入的配置项,可以指定多个项目
	//
	// 多语言项目,可能需要用到多个输入面。
	Inputs []*input.Options `yaml:"inputs"`

	// 输出配置项
	Output *output.Options `yaml:"output"`
	// contains filtered or unexported fields
}

Config 项目的配置内容

func Load

func Load(wd string) (*Config, error)

Load 加载指定目录下的配置文件

Jump to

Keyboard shortcuts

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