Documentation
¶
Index ¶
- func ComputeEnvName(c *Want) string
- func ComputePropertyName(c *Want) string
- func ListEnvNames(app string) []string
- func ListPropertyNames(app string) []string
- func NewMainModule() *application.ModuleBuilder
- func NewTestModule() *application.ModuleBuilder
- func SetDefaultAppName(name string)
- type Category
- type Context
- type Have
- type Query
- type Resolver
- type ResolverChain
- type ResolverRegistration
- type ResolverRegistry
- type Scope
- type Service
- type User
- type Want
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultAppName ¶
func SetDefaultAppName(name string)
SetDefaultAppName 设置默认的应用程序名称 这个函数是一次性的,一旦设置成功,后续的调用将无效
Types ¶
type Context ¶
type Context interface { AppName() string Query(c *Want) (*Have, error) GetPath(c *Want) afs.Path GetEnvironment() environment.Table GetProperties() properties.Table }
Context ...
type Have ¶
type Have struct { // 条件: Want *Want // 结果: Value string // 扩展结果: Path afs.Path // 可选项:如果 value 是本地路径 }
Have ... 表示查询结果
type Query ¶
type Query struct { Want *Want Have *Have // 这个字段用于列举支持的查询名称(可选项); // 如果需要查询此项,用户需要在查询时提供一个空的 map 在这里; Names map[string]*Want }
Query 表示查询某个环境变量(或属性)
type Resolver ¶ added in v0.0.2
type Resolver interface {
Resolve(q *Query, chain ResolverChain) error
}
Resolver ...
type ResolverChain ¶ added in v0.0.2
ResolverChain ...
type ResolverRegistration ¶ added in v0.0.2
ResolverRegistration ...
type ResolverRegistry ¶ added in v0.0.2
type ResolverRegistry interface {
Registrations() []*ResolverRegistration
}
ResolverRegistry ...
Click to show internal directories.
Click to hide internal directories.