health

package
v0.0.0-...-14d7a6b Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package health contains logic and helper functions for determining whether a RobustIRC network is healthy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectStatuses

func CollectStatuses(servers []string, networkPassword string) (map[string]ServerStatus, error)

func EnsureNetworkHealthy

func EnsureNetworkHealthy(servers []string, networkPassword string) (map[string]ServerStatus, error)

EnsureNetworkHealthy returns nil when all of the following is true:

  • all nodes are reachable
  • all nodes return the same leader
  • all nodes are either follower or leader (i.e. not candidate/initializing)
  • all follower nodes were recently contacted by the leader

func ResolveNetwork

func ResolveNetwork(network string) []string

Types

type ServerStatus

type ServerStatus struct {
	Server string

	State          string
	Leader         string
	Peers          []string
	AppliedIndex   uint64
	CommitIndex    uint64
	LastContact    time.Time
	ExecutableHash string
	CurrentTime    time.Time
}

func GetServerStatus

func GetServerStatus(server, networkPassword string) (ServerStatus, error)

Jump to

Keyboard shortcuts

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