Documentation ¶
Index ¶
Constants ¶
View Source
const SeparatorHeader = ":"
SeparatorHeader header key:value 分隔符
View Source
const SeparatorService = "/"
SeparatorService grpc service和method 分隔符
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { // Server 服务器地址,格式:host:port Server string // Service gRPC 服务名称,允许使用 ${} 占位符变量 Service string // Method gRPC 方法名称,允许使用 ${} 占位符变量 Method string // 请求参数 如果空,则使用当前消息负荷。参数使用JSON编码,必须和service/method要求一致。允许使用 ${} 占位符变量 Request string //Headers 请求头,可以使用 ${metadata.key} 读取元数据中的变量或者使用 ${msg.key} 读取消息负荷中的变量进行替换 Headers map[string]string }
ClientConfig 定义 gRPC 客户端配置
type ClientNode ¶
type ClientNode struct { base.SharedNode[*Client] Config ClientConfig // contains filtered or unexported fields }
ClientNode gRPC 查询节点
func (*ClientNode) Init ¶
func (x *ClientNode) Init(ruleConfig types.Config, configuration types.Configuration) error
Init 初始化 gRPC 客户端
func (*ClientNode) OnMsg ¶
func (x *ClientNode) OnMsg(ctx types.RuleContext, msg types.RuleMsg)
OnMsg 实现 Node 接口,处理消息
Click to show internal directories.
Click to hide internal directories.