search

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRawSessionFromES

func GetRawSessionFromES(ctx context.Context, req *idl.SearchReq) *esmodel.Session

func GetRawSessionHandleLocal

func GetRawSessionHandleLocal(ctx context.Context, contents []string, req *idl.SearchReq) *esmodel.Session

GetRawSessionHandleLocal 处理本地流量符合GetRawSessions接口

func GetRawSessions

func GetRawSessions(ctx context.Context, req *idl.SearchReq) *esmodel.Session

*

  • 回放某个具体session时,后端查询ES数据接口(根据SessionId查询),超时3s
  • @Return 一个session,原始数据格式

func GetTrafficFromLocal

func GetTrafficFromLocal(ctx context.Context, req *idl.SearchReq) (int, []string)

GetTrafficFromLocal 从本地读取流量

func Query

func Query(ctx context.Context, req *idl.SearchReq, timeout time.Duration) ([]byte, error)

func SearchPreHandle

func SearchPreHandle(req *idl.SearchReq) *idl.SearchReq

SearchPreHandle 处理Search接口参数

Types

type DSL

type DSL struct {
	Size   int                    `json:"size"`
	From   int                    `json:"from"`
	Query  map[string]interface{} `json:"query"`
	Source []string               `json:"_source,omitempty"`
	Sort   map[string]interface{} `json:"sort"`
}

type SearchRecord

type SearchRecord struct {
	Project   string              `json:"project"`
	SessionId string              `json:"sessionId"`
	Timestamp string              `json:"timestamp"`
	Req       string              `json:"req"`
	RawReq    string              `json:"-"`
	Res       string              `json:"res"`
	RawRes    string              `json:"-"`
	Actions   []map[string]string `json:"actions"`
}

func AppendFlowList

func AppendFlowList(flowList []*SearchRecord, req *idl.SearchReq, session esmodel.Session) []*SearchRecord

AppendFlowList 筛选流量并格式化,并追加到flowList数组

func Search(ctx context.Context, req *idl.SearchReq) []*SearchRecord

*

  • 前端查询ES数据接口(各种查询条件),超时10s
  • @Return 多条session,封装成前端展示数据结构

func SearchFromES

func SearchFromES(ctx context.Context, req *idl.SearchReq) []*SearchRecord

SearchFromES 从es读取数据,并处理按Search接口返回

func SearchHandleLocal

func SearchHandleLocal(contents []string, req *idl.SearchReq) []*SearchRecord

SearchHandleLocal 处理本地流量符合Search接口

type SearchRecords

type SearchRecords []*SearchRecord

func (SearchRecords) Len

func (s SearchRecords) Len() int

Len()

func (SearchRecords) Less

func (s SearchRecords) Less(i, j int) bool

Less():成绩将有低到高排序

func (SearchRecords) Swap

func (s SearchRecords) Swap(i, j int)

Swap()

Jump to

Keyboard shortcuts

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