Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
BI统计 一:需要统计的数据 全局ID:可用于重发排重 事件ID:用于区分参数含义 时间戳:标识发送时间 参数: 任意kv结构
二:支持的特性 1.异步发送 2.缓存一定数量,超过则会丢失 3.可批量发送 4.json编码 5.默认http发送,可扩展
三:一些注意 1.虽然会缓存数据,但是超过上限后依然会丢弃数据,防止占用内存过大导致宕机 2.默认实现了http协议,效率可能没有那么高,可考虑使用MQ
type HttpTransport ¶
type HttpTransport struct {
// contains filtered or unexported fields
}
func (*HttpTransport) Init ¶
func (t *HttpTransport) Init()
type Options ¶
type Options struct { Tran Transport // 默认http URL string // 发送地址 Batch int // 批量发送大小 Retry int // 尝试重发次数 Max int // 最大缓存数,超出则丢弃 Wait time.Duration // 最大等待时间,超过此时间,则强制退出 Encode Encode // 编码器 }
配置信息,通常只需要设置URL,其他使用默认值
Click to show internal directories.
Click to hide internal directories.