Documentation
¶
Overview ¶
Package gobuild 提供了对 Go 语言热编译的支持
Index ¶
Constants ¶
View Source
const ( LogTypeSuccess int8 = iota LogTypeInfo LogTypeWarn LogTypeError LogTypeIgnore )
日志类型
View Source
const MinWatcherFrequency = 1 * time.Second
MinWatcherFrequency 监视器更新频率的最小值
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleLogs ¶
type ConsoleLogs struct {
Logs chan *Log
// contains filtered or unexported fields
}
ConsoleLogs 将日志输出到控制台
func NewConsoleLogs ¶
func NewConsoleLogs(showIgnore bool) *ConsoleLogs
NewConsoleLogs 声明 ConsoleLogs 实例
type Options ¶ added in v0.9.0
type Options struct {
// 指定本地化的输出对象
//
// 如果为空,表示原样输出,不具备本地化的功能。
Printer *message.Printer
// 为 go build 最后的文件参数
//
// 可以为空,表示当前目录。
MainFiles string
// 指定可执行文件输出的文件路径
//
// 为空表示默认值,若不带路径信息,会附加在 Dirs 的第一个路径上;
//
// windows 系统无须指定 .exe 扩展名,会自行添加。
//
// 如果带路径信息,则会使用该文件所在目录作为工作目录。
OutputName string
// 传递各个工具的参数
//
// 大致有以下几个,具体可参考 go build 的 xxflags 系列参数。
// - asm --> asmflags
// - gccgo --> gccgoflags
// - gc --> gcflags
// - ld --> ldflags
Flags map[string]string
// 指定监视的文件扩展名
//
// 为空表示不监视任何文件,* 表示监视所有文件
Exts string
// 传递给编译成功后的程序的参数
AppArgs string
// 是否监视子目录
Recursive bool
// 表示需要监视的目录
//
// 至少指定一个目录,第一个目录被当作主目录,将编译其下的文件作为执行主体。
//
// 如果 OutputName 中未指定目录的话,第一个目录会被当作工作目录使用。
Dirs []string
// 监视器的更新频率
//
// 只有文件更新的时长超过此值,才会被定义为更新。防止文件频繁修改导致的频繁编译调用。
//
// 此值不能小于 MinWatcherFrequency。
//
// 默认值为 MinWatcherFrequency 表示的值。
WatcherFrequency time.Duration
// contains filtered or unexported fields
}
Options 热编译的选项
Click to show internal directories.
Click to hide internal directories.