modulepackage
0.0.0-20241109221219-16439318ddfa
Repository: https://github.com/nrm21/support.git
Documentation: pkg.go.dev
# README
support
This is just a repo for simple generic support functions that I might use in many programs over and over. Like read config file form disk or marshal objects in memory into a json string, etc...
# Functions
Deletes the given key from etcd and returns the amount deleted.
GetOutboundIP gets the preferred outbound ip of the current node at runtime.
ReadConfigFileContents reads and return the contents of a file text or binary.
ReadFromEtcd reads all sub-prefixes from a given key and returns them in a (string, byte array) map structure.
SetupCloseHandler detects ctrl-c pressed by user to break loop and close program.
WatchReadFromEtcd watches all sub-prefixes from a given key and returns any changes to them in a (string, byte array) map structure, this fuction loops forever unless broken from explicitly.
WriteToEtcd writes once to a given key in etcd, returns nil of no error.