package util

import "github.com/purpleidea/mgmt/etcd/util"

Index

Functions

func CmpURLsMap

func CmpURLsMap(m1, m2 etcdtypes.URLsMap) error

CmpURLsMap compares two URLsMap's, and returns nil if they are the same.

func CopyURLs

func CopyURLs(urls etcdtypes.URLs) (etcdtypes.URLs, error)

CopyURLs copies a URLs. TODO: submit this upstream to etcd ?

func CopyURLsMap

func CopyURLsMap(urlsMap etcdtypes.URLsMap) (etcdtypes.URLsMap, error)

CopyURLsMap copies a URLsMap. TODO: submit this upstream to etcd ?

func FromStringListToURLs

func FromStringListToURLs(surls []string) (etcdtypes.URLs, error)

FromStringListToURLs takes a list of string urls and converts them into the native type.

func FromURLsMapToStringList

func FromURLsMapToStringList(m etcdtypes.URLsMap) []string

FromURLsMapToStringList flattens a map of URLs into a single string list. Remember to sort the result if you want it to be deterministic!

func FromURLsToStringList

func FromURLsToStringList(urls etcdtypes.URLs) []string

FromURLsToStringList turns a list of etcd URLs into a list of strings using the full URL scheme.

func LocalhostURLs

func LocalhostURLs(urls etcdtypes.URLs) etcdtypes.URLs

LocalhostURLs returns the most localhost like URLs for direct connection. This gets clients to talk to the local servers first before looking remotely. TODO: improve this algorithm as it's currently a bad heuristic

Source Files

util.go

Version
v0.0.0-20250322185616-c50a578426f1 (latest)
Published
Mar 22, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
4 days ago

Tools for package owners.