libs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DryRunTable

func DryRunTable()

func MoveCommandsToTable

func MoveCommandsToTable(input []MoveCommand)

func RebalanceInfoToTable

func RebalanceInfoToTable(input rebalanceInfo)

func RerouteResponseToTable

func RerouteResponseToTable(input rerouteResponse)

func SettingsToTable

func SettingsToTable(input map[string]interface{})

func ShardsAvailableForMoveToTable

func ShardsAvailableForMoveToTable(input []shard)

Types

type Elastic

type Elastic struct {
	Logger       *Logger
	HttpClient   *http.Client
	HttpUsername string
	HttpPassword string
}

func (Elastic) ExecuteMoveCommands

func (e Elastic) ExecuteMoveCommands(url string, moveCommands ShardsReroute, dryRun bool) rerouteResponse

func (Elastic) GetDiskSpaceInfo

func (e Elastic) GetDiskSpaceInfo(url string, allowedPercentOfDifference int, fromNode string, toNode string) rebalanceInfo

GetDiskSpaceInfo func

func (Elastic) GetShardsInfo

func (e Elastic) GetShardsInfo(url string, diskSpaceInfo rebalanceInfo, shardsToMove int) []shard

func (Elastic) PrepareMoveCommand

func (e Elastic) PrepareMoveCommand(shards []shard, fromNode, toNode string) ShardsReroute

type Logger

type Logger struct {
	Instance  *log.Logger
	LogFormat string
}

func (*Logger) Init

func (l *Logger) Init(logFormat string, logfile string)

type MoveCommand

type MoveCommand struct {
	Move struct {
		Index    string `json:"index"`
		Shard    string `json:"shard"`
		FromNode string `json:"from_node"`
		ToNode   string `json:"to_node"`
	} `json:"move"`
}

type ShardsReroute

type ShardsReroute struct {
	Commands []MoveCommand `json:"commands"`
}

Jump to

Keyboard shortcuts

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