options

package
v0.0.0-...-643d18f Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package options 输入和输出的配置项

Index

Constants

View Source
const (
	ApidocJSON  = "apidoc+json"
	ApidocYAML  = "apidoc+yaml"
	OpenapiJSON = "openapi+json"
	OpenapiYAML = "openapi+yaml"
	RAMLYAML    = "raml+yaml"
)

文档类型定义

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Lang      string   `yaml:"lang"`               // 输入的目标语言
	Dir       string   `yaml:"dir"`                // 源代码目录,建议使用绝对路径
	Exts      []string `yaml:"exts,omitempty"`     // 需要扫描的文件扩展名,若未指定,则使用默认值
	Recursive bool     `yaml:"recursive"`          // 是否查找 Dir 的子目录
	Encoding  string   `yaml:"encoding,omitempty"` // 文件的编码,为空表示 utf-8
}

Input 指定输入内容的相关信息。

func Detect

func Detect(dir string, recursive bool) ([]*Input, error)

Detect 检测指定目录下的内容,并为其生成一个合适的 Input 实例。

检测依据为根据扩展名来做统计,数量最大且被支持的获胜。

type Output

type Output struct {
	// 文档的保存路径,建议使用绝对路径。
	Path string `yaml:"path,omitempty"`

	// 输出类型
	Type string `yaml:"type,omitempty"`

	// 只输出该标签的文档,若为空,则表示所有。
	Tags []string `yaml:"tags,omitempty"`
}

Output 指定了渲染输出的相关设置项。

Jump to

Keyboard shortcuts

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