transfer

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: BSD-3-Clause Imports: 6 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 CLSDto

type CLSDto struct {
	// CLS 日志主题 ID
	TopicId string `msgpack:"topic_id" validate:"required"`

	// 写入记录
	Record map[string]string `msgpack:"record" validate:"required"`

	// 时间
	Time time.Time `msgpack:"time" validate:"required"`
}

type InfluxDto

type InfluxDto struct {
	// 度量
	Measurement string `msgpack:"measurement" validate:"required"`

	// 标签
	Tags map[string]string `msgpack:"tags" validate:"required"`

	// 字段
	Fields map[string]interface{} `msgpack:"fields" validate:"required"`

	// 时间
	Time time.Time `msgpack:"time" validate:"required"`
}

type Option

type Option struct {
	// 主题
	Topic string `msgpack:"topic"`
	// 描述
	Description string `msgpack:"description"`
}

type Payload

type Payload []byte

func NewPayload

func NewPayload(data interface{}) (payload Payload, err error)

NewPayload 创建载荷

type Transfer

type Transfer struct {
	Namespace string
	Js        nats.JetStreamContext
	Store     nats.ObjectStore
}

func New

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

func (*Transfer) Get

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

func (*Transfer) Publish

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

func (*Transfer) Remove

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

func (*Transfer) Set

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

Jump to

Keyboard shortcuts

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