pkg

package
v0.0.0-...-96272ab Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(dst string, src string)

func SliceIn

func SliceIn(slice []string, val string) (int, bool)

Types

type ES

type ES struct {
	Client *elastic.Client
	Ctx    context.Context
}

func (*ES) GetIndexInfo

func (e *ES) GetIndexInfo(name string) (SettingsIndexInfo, error)

func (*ES) GetIndexStatus

func (e *ES) GetIndexStatus(name string) (IndexStatus, error)

*

type IndexStatus struct {
	IndexName string
	AliaseName string
	PlanIndexA bool
	PlanIndexB bool
}
IndexName 为空  				表示尚未场景索引,走首次推送流程
IndexName 有值 AliaseName 为空	表示有索引,但是非程序生成,返回空信息
IndexName 有值 AliaseName 有值   PlanIndexA&PlanIndexB 其中一个为true    表示非首次运行
PlanIndexA&PlanIndexB  为true   表示程序正在运行

func (*ES) NewEsObj

func (e *ES) NewEsObj(config EsConfig) (*elastic.Client, error)

map[creation_date:1610278432105 number_of_replicas:1 number_of_shards:1 provided_name:yandex uuid:J73-HO52Tjik7kbbEBvYDA version:map[created:7070199]]

type EsConfig

type EsConfig struct {
	Addresses string
	Username  string
	Password  string
}

type EsInterface

type EsInterface interface {
	NewEsObj(config EsConfig) (*elastic.Client, error)
	GetIndexInfo(name string) (SettingsIndexInfo, error)
	GetIndexStatus(name string) (IndexStatus, error)
}

type IndexStatus

type IndexStatus struct {
	IndexName  string
	AliaseName string
	PlanIndexA bool
	PlanIndexB bool
}

type SettingsIndexInfo

type SettingsIndexInfo struct {
	Creation_date      string
	Number_of_replicas string
	Number_of_shards   string
	Provided_name      string
	AliaseName         map[string]interface{}
	Uuid               string
	Version            map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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