transfer

package module
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: BSD-3-Clause Imports: 5 Imported by: 3

README

Weplanx Transfer

Github Actions Coveralls github GitHub go.mod Go version Go Report Card Release GitHub license

日志传输客户端是以 Push 为主的模式,作用是对日志流队列进行统一管理,将高频写入的日志数据进行削峰缓冲,同时填补非高可用日志系统的可靠性,配合相同命名空间的日志采集服务写入日志系统

版本 *.*.*elastic-transfer 已归档的分支项目 ,请使用 v*.*.* 发布的版本(预发布用于构建测试)

技术文档:语雀

License

BSD-3-Clause License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	// 主题
	Measurement string `json:"measurement"`
	// 描述
	Description string `json:"description"`
}

type Payload

type Payload struct {
	// 标签
	Tags map[string]string `json:"tags"`

	// 字段
	Fields map[string]interface{} `json:"fields"`

	// 时间
	Time time.Time `json:"time"`
}

Payload 载荷

type Transfer

type Transfer struct {
	// 命名空间
	Namespace string
	// Nats JetStream
	Js nats.JetStreamContext
	// Nats ObjectStore
	Store nats.ObjectStore
}

func New

func New(namespace string, js nats.JetStreamContext) (x *Transfer, err error)

New 新建传输

func (*Transfer) Get

func (x *Transfer) Get(measurement string) (result map[string]interface{}, err error)

Get 获取传输器信息

func (*Transfer) Publish

func (x *Transfer) Publish(ctx context.Context, measurement string, payload Payload) (err error)

Publish 发布

func (*Transfer) Remove

func (x *Transfer) Remove(key string) (err error)

Remove 移除配置

func (*Transfer) Set

func (x *Transfer) Set(measurement string, option Option) (err error)

Set 设置传输器

Jump to

Keyboard shortcuts

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