config

package
v0.0.0-...-33c0942 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPeerIDs

func ExtractPeerIDs(cfg *ClusterConfig) []int

Types

type ClusterConfig

type ClusterConfig struct {
	XMLName          xml.Name      `xml:"ClusterConfig"`
	MyID             int           `xml:"MyID"`
	ElectionTimeout  time.Duration `xml:"ElectionTimeout"`
	HeartbeatTimeout time.Duration `xml:"HeartbeatTimeout"`
	CommitTimeout    time.Duration `xml:"CommitTimeout"`
	Peers            []Peer        `xml:"Peers>Peer"`
	ListenerAddress  string        `xml:"ListenerAddress"`
}

func LoadConfigFromXML

func LoadConfigFromXML(filePath string) (*ClusterConfig, error)

LoadConfigFromXML loads the configuration settings from an XML file. It takes a file path as a parameter and returns a pointer to a ClusterConfig struct and an error.

type Peer

type Peer struct {
	XMLName     xml.Name `xml:"Peer"`
	PeerID      int      `xml:"PeerID"`
	PeerAddress string   `xml:"PeerAddress"`
}

Jump to

Keyboard shortcuts

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