escache

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

ES引擎层

Index

Constants

View Source
const (
	IndexNameNullError = 200001
	AliasNameNullError = 200002
)

Variables

View Source
var ParmasNullError = map[int]string{
	IndexNameNullError: "索引名不能为空",
	AliasNameNullError: "别名不能为空",
}
View Source
var ReqParmasValid = errors.New("请求参数无效")

默认异常

Functions

func EsPwdESBDecrypt

func EsPwdESBDecrypt(cryptedStr string) (string, error)

func EsPwdESBEncrypt

func EsPwdESBEncrypt(pwd string) (string, error)

func NewEsClientV6

func NewEsClientV6(esConnectConfig *EsConnect) (esClient *elasticV6.Client, err error)

func NewEsClientV7

func NewEsClientV7(esConnectConfig *EsConnect) (esClient *elasticV7.Client, err error)

func NewEsClientV8

func NewEsClientV8(esConnectConfig *EsConnect) (esClient *elasticV7.Client, err error)

Types

type AnalysisFilter

type AnalysisFilter struct {
	FilterType string `json:"filterType"`
	Filts      []struct {
		FilterType string `json:"filterType"`
		Filts      []struct {
			ColumnName string      `json:"columnName"`
			Comparator string      `json:"comparator"`
			FilterType string      `json:"filterType"`
			Ftv        interface{} `json:"ftv"`
		} `json:"filts,omitempty"`
		Relation   string      `json:"relation,omitempty"`
		ColumnName string      `json:"columnName,omitempty"`
		Comparator string      `json:"comparator,omitempty"`
		Ftv        interface{} `json:"ftv,omitempty"`
	} `json:"filts"`
	Relation string `json:"relation"`
}

type CancelTask

type CancelTask struct {
	EsConnect int    `json:"es_connect"`
	TaskID    string `json:"task_id"`
}

type CleanupeRepository

type CleanupeRepository struct {
	EsConnect  int    `json:"es_connect"`
	Repository string `json:"name"`
}

type CreateSnapshot

type CreateSnapshot struct {
	SnapshotName       string   `json:"snapshotName"`
	RepositoryName     string   `json:"repositoryName"`
	IndexList          []string `json:"indexList"`
	IgnoreUnavailable  *bool    `json:"ignore_unavailable"`
	IncludeGlobalState *bool    `json:"include_global_state"`
	Partial            *bool    `json:"partial"`
	Wait               *bool    `json:"wait"`
	EsConnect          int      `json:"es_connect"`
}

type CrudFilter

type CrudFilter struct {
	Relation  AnalysisFilter `json:"relation"`
	SortList  []SortStruct   `json:"sort_list"`
	EsConnect int            `json:"es_connect"`
	IndexName string         `json:"index_name"`
	Page      int            `json:"page"`
	Limit     int            `json:"limit"`
}

type DeleteSnapshot

type DeleteSnapshot struct {
	SnapshotName   string `json:"snapshotName"`
	RepositoryName string `json:"repositoryName"`
	EsConnect      int    `json:"es_connect"`
}

type EsAliasInfo

type EsAliasInfo struct {
	EsConnect        int      `json:"es_connect"`
	Settings         Json     `json:"settings"`
	IndexName        string   `json:"index_name"`
	AliasName        string   `json:"alias_name"`
	NewAliasNameList []string `json:"new_alias_name_list"`
	NewIndexList     []string `json:"new_index_list"`
	Types            int      `json:"types"`
}

type EsCache

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

Es连接缓存

func NewEsCache

func NewEsCache() *EsCache

es

func (*EsCache) Get

func (this *EsCache) Get(id int) *EsConnect

通过es连接表 的id获取一个保存在内存的id

func (*EsCache) Rem

func (this *EsCache) Rem(id int)

通过id删除一个内存中的es实例

func (*EsCache) Set

func (this *EsCache) Set(id int, esClient *EsConnect)

新增一个es实例

type EsCat

type EsCat struct {
	EsConnect        int    `json:"es_connect"`
	Cat              string `json:"cat"`
	IndexBytesFormat string `json:"index_bytes_format"`
}

type EsClientV7

type EsClientV7 struct {
	Client *elasticV7.Client
	// contains filtered or unexported fields
}

type EsConnect

type EsConnect struct {
	Ip      string `json:"ip" db:"ip"`
	User    string `json:"user" db:"user"`
	Pwd     string `json:"pwd" db:"pwd"`
	Version int    `json:"version" db:"version"`
}

func GetEsClientByID

func GetEsClientByID(id int) (*EsConnect, error)

获取es配置信息

type EsConnectID

type EsConnectID struct {
	EsConnectID int `json:"es_connect"`
}

type EsDocDeleteRowByID

type EsDocDeleteRowByID struct {
	EsConnect int    `json:"es_connect"`
	ID        string `json:"id"`
	IndexName string `json:"index_name"`
	Type      string `json:"type"`
}

type EsDocUpdateByID

type EsDocUpdateByID struct {
	EsConnect int    `json:"es_connect"`
	ID        string `json:"id"`
	JSON      Json   `json:"json"`
	Type      string `json:"type_name"`
	Index     string `json:"index"`
}

type EsIndexInfo

type EsIndexInfo struct {
	EsConnect int    `json:"es_connect"`
	Settings  Json   `json:"settings"`
	IndexName string `json:"index_name"`
	Types     string `json:"types"`
}

type EsMapGetProperties

type EsMapGetProperties struct {
	EsConnectID int    `json:"es_connect"`
	IndexName   string `json:"index_name"`
}

type EsMappingInfo

type EsMappingInfo struct {
	IndexNameList []string `json:"index_name_list"`
	EsConnect     int      `json:"es_connect"`
	Mappings      Json     `json:"mappings"`
	IndexName     string   `json:"index_name"`
}

type EsOptimize

type EsOptimize struct {
	EsConnect int    `json:"es_connect"`
	IndexName string `json:"index_name"`
	Command   string `json:"command"`
}

type EsReIndexInfo

type EsReIndexInfo struct {
	EsConnect int `json:"es_connect"`
	UrlValues struct {
		Timeout             string `json:"timeout"`
		RequestsPerSecond   int    `json:"requests_per_second"`
		Slices              int    `json:"slices"`
		Scroll              string `json:"scroll"`
		WaitForActiveShards string `json:"wait_for_active_shards"`
		Refresh             string `json:"refresh"`
		WaitForCompletion   *bool  `json:"wait_for_completion"`
	} `json:"url_values"`
	Body util.Map `json:"body"`
}

type EsRest

type EsRest struct {
	EsConnect int    `json:"es_connect"`
	Method    string `json:"method"`
	Body      string `json:"body"`
	Path      string `json:"path"`
}

type EsSnapshotInfo

type EsSnapshotInfo struct {
	EsConnect        int      `json:"es_connect"`
	SnapshotInfoList []string `json:"snapshot_info_list"`
}

type EsTaskInfo

type EsTaskInfo struct {
	EsConnect    int      `json:"es_connect"`
	TaskId       []string `json:"task_id"`
	Actions      []string `json:"actions"`
	NodeId       []string `json:"node_id"`
	ParentTaskId string   `json:"parent_task_id"`
}

type Json

type Json map[string]interface{}

type Page

type Page struct {
	PageNum  int
	PageSize int
}

type SnapshotCreateRepository

type SnapshotCreateRepository struct {
	EsConnect              int    `json:"es_connect"`
	Repository             string `json:"name"`
	Type                   string `json:"type"`
	Location               string `json:"location"`
	Compress               string `json:"compress"`
	MaxRestoreBytesPerSec  string `json:"max_restore_bytes_per_sec"`
	MaxSnapshotBytesPerSec string `json:"max_snapshot_bytes_per_sec"`
	ChunkSize              string `json:"chunk_size"`
	Readonly               string `json:"readonly"`
}

type SnapshotDelete

type SnapshotDelete struct {
	EsConnect  int    `json:"es_connect"`
	Repository string `json:"repository"`
	Snapshot   string `json:"snapshot"`
}

type SnapshotDeleteRepository

type SnapshotDeleteRepository struct {
	EsConnect  int    `json:"es_connect"`
	Repository string `json:"name"`
}

type SnapshotDetail

type SnapshotDetail struct {
	EsConnect  int    `json:"es_connect"`
	Repository string `json:"repository"`
	Snapshot   string `json:"snapshot"`
}

type SnapshotList

type SnapshotList struct {
	EsConnect  int    `json:"es_connect"`
	Repository string `json:"repository"`
}

type SnapshotRestore

type SnapshotRestore struct {
	SnapshotName       string   `json:"snapshotName"`
	RepositoryName     string   `json:"repositoryName"`
	IndexList          []string `json:"indexList"`
	IgnoreUnavailable  *bool    `json:"ignore_unavailable"`
	IncludeGlobalState *bool    `json:"include_global_state"`
	Partial            *bool    `json:"partial"`
	Wait               *bool    `json:"wait"`
	EsConnect          int      `json:"es_connect"`
	RenamePattern      string   `json:"rename_pattern"`
	RenameReplacement  string   `json:"rename_replacement"`
}

type SnapshotStatus

type SnapshotStatus struct {
	SnapshotName   string `json:"snapshot"`
	RepositoryName string `json:"repository"`
	EsConnect      int    `json:"es_connect"`
}

type Sort

type Sort struct {
	Field     string
	Ascending bool
}

type SortStruct

type SortStruct struct {
	Col      string `json:"col"`
	SortRule string `json:"sortRule"`
}

type TaskList

type TaskList struct {
	EsConnect int `json:"es_connect"`
}

type UpdateMapping

type UpdateMapping struct {
	EsConnect  int    `json:"es_connect"`
	IndexName  string `json:"index_name"`
	TypeName   string `json:"type_name"`
	Properties Json   `json:"properties"`
}

Jump to

Keyboard shortcuts

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