Documentation
¶
Index ¶
- type CommandArgs
- type ComponentConfig
- type ComponentElement
- type ConfigDOM
- type ConfigGoBuilder
- type ConfigPathFinder
- func (inst *ConfigPathFinder) FindConfigPackageDir(ctx *Context) error
- func (inst *ConfigPathFinder) FindGoMod(ctx *Context) error
- func (inst *ConfigPathFinder) FindProjectConfig(ctx *Context) error
- func (inst *ConfigPathFinder) FindSourceFiles(ctx *Context) error
- func (inst *ConfigPathFinder) Init(ctx *Context) error
- type Context
- type GoModFile
- type GssConfigLoader
- type PackageDirectory
- type ProjectConfigFile
- type SourceFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandArgs ¶
type CommandArgs struct {
Context *Context
PWD fs.Path
ConfigFileName string // default("") = project.config.json
}
CommandArgs 表示一个命令上下文
type ComponentConfig ¶
type ComponentConfig struct {
// contains filtered or unexported fields
}
ComponentConfig 组件配置
type ComponentElement ¶
type ComponentElement struct {
ID string `json:"id"`
Class string `json:"class"`
Type string `json:"type"`
Scope string `json:"scope"`
InitMethod string `json:"initMethod"`
DestroyMethod string `json:"destroyMethod"`
Inject map[string]string `json:"inject"`
}
ComponentElement 表示一个组件的配置项
type ConfigDOM ¶
type ConfigDOM struct {
Components []*ComponentElement `json:"components"`
Package string `json:"package"`
}
ConfigDOM 是配置文件的 “gss.config.json” DOM
type ConfigGoBuilder ¶
type ConfigGoBuilder struct {
// contains filtered or unexported fields
}
ConfigGoBuilder 配置生成器
func (*ConfigGoBuilder) Create ¶
func (inst *ConfigGoBuilder) Create() (string, error)
type ConfigPathFinder ¶
type ConfigPathFinder struct {
}
ConfigPathFinder 是一个配置路径查找器
func (*ConfigPathFinder) FindConfigPackageDir ¶
func (inst *ConfigPathFinder) FindConfigPackageDir(ctx *Context) error
FindConfigPackageDir 查找配置包目录
func (*ConfigPathFinder) FindGoMod ¶
func (inst *ConfigPathFinder) FindGoMod(ctx *Context) error
FindGoMod 方法从当前路径向上查找 go.mod 文件
func (*ConfigPathFinder) FindProjectConfig ¶
func (inst *ConfigPathFinder) FindProjectConfig(ctx *Context) error
FindProjectConfig 查找项目的配置
func (*ConfigPathFinder) FindSourceFiles ¶
func (inst *ConfigPathFinder) FindSourceFiles(ctx *Context) error
FindSourceFiles 查找配置源文件
func (*ConfigPathFinder) Init ¶
func (inst *ConfigPathFinder) Init(ctx *Context) error
Init 方法初始化一个 CommandContext 对象
type Context ¶
type Context struct {
Args *CommandArgs
GoMod *GoModFile
ProjectConfig *ProjectConfigFile
PackageDirectory *PackageDirectory
}
Context 自动配置工具的上下文
type GssConfigLoader ¶
type GssConfigLoader struct {
}
GssConfigLoader 是配置加载器
func (*GssConfigLoader) Load ¶
func (inst *GssConfigLoader) Load(ctx *ProjectConfigFile) error
Load 加载配置
type PackageDirectory ¶
type PackageDirectory struct {
Context *Context
Path fs.Path
Builder *ConfigGoBuilder
Sources []*SourceFile
}
PackageDirectory 表示一个围绕 go package 文件夹周边的环境
type ProjectConfigFile ¶
ProjectConfigFile 表示一个围绕 gss.config.json 文件周边的环境
type SourceFile ¶
SourceFile 表示一个围绕 *.go 源文件周边的环境
Source Files
¶
Click to show internal directories.
Click to hide internal directories.