elasticsearch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// es消息队列
	EsChan chan EsMsg
)

Functions

func InitElastic

func InitElastic(esAddress []string, chanSize int) (err error)

初始化elasticsearch

func SendMsgToEs

func SendMsgToEs(msg EsMsg, topic string) (err error)

发送数据到elasticsearch

Types

type EsClient

type EsClient struct {
	// contains filtered or unexported fields
}

elasticsearch 客户端

type EsMsg

type EsMsg struct {
	Msg   []byte
	Topic string
}

kafka获取消息存储结构

func GetOneMsg

func GetOneMsg() (msg EsMsg)

从eschan中获取一条数据

type SesMsg

type SesMsg struct {
	Msg   string `json:"msg"`
	Ip    string `json:"ip"`
	Topic string `json:"topic"`
}

发送到es消息存储结构

Jump to

Keyboard shortcuts

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