Documentation
¶
Index ¶
Constants ¶
View Source
const ( MODULE_HEALTHCHECK = "健康检查" MODULE_SCHEMA = "Schema" MODULE_RUN = "执行扩展节点" )
Variables ¶
View Source
var Cfg = new(Config)
Cfg 全局配置(需要先执行MustLoad,否则拿不到配置)
Functions ¶
Types ¶
type Config ¶
type Config struct {
Log logger.Config `json:"log" yaml:"log"`
FlowEngine Grpc `json:"flowEngine" yaml:"flowEngine"`
Extension struct {
Id string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Timeout uint `json:"timeout" yaml:"timeout"`
} `json:"extension" yaml:"extension"`
Pprof struct {
Enable bool `json:"enable" yaml:"enable"`
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
} `json:"pprof" yaml:"pprof"`
EtcdConfig string `json:"etcdConfig" yaml:"etcdConfig"`
Etcd etcd.Config `json:"etcd" yaml:"etcd"`
API apiConfig.Config `json:"api" yaml:"api"`
}
type Extension ¶
type Extension interface {
// Schema
// @description 查询schema
// @param locale 国际化
// @return schema "驱动配置schema"
Schema(ctx context.Context, app App, locale string) (schema string, err error)
// Run
// @description 执行算法服务
// @param input 执行参数 {} input 执行参数,应与输出的schema格式相同
// @return result "自定义返回的格式,应与输出的schema格式相同"
Run(ctx context.Context, app App, input []byte) (result map[string]interface{}, err error)
}
Click to show internal directories.
Click to hide internal directories.