es

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndex

func CreateIndex(conn *ConnInfo, name, mappingContent string) error

CreateIndex used to create index in es

func DefaultContext

func DefaultContext() context.Context

DefaultContext used to return default es context

func DeleteIndex

func DeleteIndex(conn *ConnInfo, name string) error

DeleteIndex used to delete index in es

func DoMaxAggreation

func DoMaxAggreation(conn *ConnInfo, index, filed, timeFiled string, begin, end int64) []interface{}

DoMaxAggreation used to max aggreation

func FetchRawWithConn

func FetchRawWithConn(conn *ConnInfo, index, docType, docID string) (*json.RawMessage, bool)

FetchRawWithConn used to get doc

func FetchWithConn

func FetchWithConn(conn *ConnInfo, index, docType, docID string, entity interface{}) bool

FetchWithConn used to get doc

func MakeESTimeStamp

func MakeESTimeStamp(timeObj time.Time) int64

MakeESTimeStamp used to make es timestamp

func Push

func Push(index, docType, docID string) error

Push used to insert data to es

func PushBulk

func PushBulk(conn *ConnInfo, index, docType string, docIDs []string, docs []interface{}) error

PushBulk used to insert bulk data to es

func PushBulkPro

func PushBulkPro(conn *ConnInfo, index, doc string, input []interface{}, converter BuildStoreHandler) (successCount int, err error)

PushBulkPro used to push data by PushBulk

func SetBulkCount

func SetBulkCount(count int)

SetBulkCount used to set bulk count

Types

type BuildStoreHandler

type BuildStoreHandler func(i interface{}) ([]string, []interface{})

BuildStoreHandler used express the function type for build store item

type ConnInfo

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

ConnInfo used to cache es client

func GetConn

func GetConn(url, user, pass string) (*ConnInfo, error)

GetConn used to get a connection from the es server

func NewConnInfo

func NewConnInfo(url, user, pass string) *ConnInfo

NewConnInfo used create ConnInfo

type DataTupleHandler

type DataTupleHandler func(rowIndex int, row []sql.RawBytes) ([]interface{}, error)

DataTupleHandler used process the raw data to target object

type ValueObject

type ValueObject struct {
	Value interface{} `json:"value"`
}

ValueObject used

Jump to

Keyboard shortcuts

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