opengemini

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryConfig

type QueryConfig struct {
	// Server 服务器地址,格式:host:port,多个地址用逗号分隔
	Server string
	// Database 数据库,允许使用 ${} 占位符变量
	Database string
	// Username 用户名
	Username string
	// Password 密码
	Password string
	// Token 如果token 不为空,则使用token认证,否则使用用户名密码认证
	Token string
	// 查询语句,允许使用 ${} 占位符变量
	Command string
}

QueryConfig 定义 OpenGemini 客户端配置

type QueryNode

type QueryNode struct {
	*WriteNode
	Config QueryConfig
	// contains filtered or unexported fields
}

QueryNode opengemini 查询节点

func (*QueryNode) Init

func (x *QueryNode) Init(ruleConfig types.Config, configuration types.Configuration) error

Init 初始化 OpenGemini 客户端

func (*QueryNode) New

func (x *QueryNode) New() types.Node

New 实现 Node 接口,创建新实例

func (*QueryNode) OnMsg

func (x *QueryNode) OnMsg(ctx types.RuleContext, msg types.RuleMsg)

OnMsg 实现 Node 接口,处理消息

func (*QueryNode) Type

func (x *QueryNode) Type() string

Type 实现 Node 接口,返回组件类型

type WriteConfig

type WriteConfig struct {
	// Server 服务器地址,格式:host:port,多个地址用逗号分隔
	Server string
	// Database 数据库,允许使用 ${} 占位符变量
	Database string
	// Username 用户名
	Username string
	// Password 密码
	Password string
	// Token 如果 Token 不为空,使用 opengemini.AuthTypeToken 认证
	Token string
}

WriteConfig 定义 OpenGemini 客户端配置

type WriteNode

type WriteNode struct {
	base.SharedNode[opengemini.Client]

	Config WriteConfig
	// contains filtered or unexported fields
}

WriteNode opengemini 写节点

func (*WriteNode) Destroy

func (x *WriteNode) Destroy()

Destroy 清理资源

func (*WriteNode) GetInstance

func (x *WriteNode) GetInstance() (interface{}, error)

func (*WriteNode) Init

func (x *WriteNode) Init(ruleConfig types.Config, configuration types.Configuration) error

Init 初始化 OpenGemini 客户端

func (*WriteNode) New

func (x *WriteNode) New() types.Node

New 实现 Node 接口,创建新实例

func (*WriteNode) OnMsg

func (x *WriteNode) OnMsg(ctx types.RuleContext, msg types.RuleMsg)

OnMsg 实现 Node 接口,处理消息

func (*WriteNode) Type

func (x *WriteNode) Type() string

Type 实现 Node 接口,返回组件类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL