Categorygithub.com/eensymachines-in/utilities
modulepackage
1.5.6
Repository: https://github.com/eensymachines-in/utilities.git
Documentation: pkg.go.dev

# Functions

AfterSocketEvent : this sets up a listener to a socket, and calls the play function only after the socket has received an event caller function can set the size of the expected event message - defaults to 512 if set to lesser than that returns a func to stop the event loop, and error incase any.
Wide open cors policy, no restrictions on the origin, but all origins have to be working on port 80 */.
No description provided by the author
FileWatcher : sets up an infinite loop for an interval that will watch the file for chanages Upon finding a change - will callback where the client code can do what it needs to lower the tick time duration, faster is the file change detect, but higher is the load on CPU FileAction is called everytime the file is found to have been changed.
ListenOnUnixSocket : sets up a listener, returns a function to start, stop and error incase the socket could not be listened https://eli.thegreenplace.net/2019/unix-domain-sockets-in-go/.
No description provided by the author
MongoPingTest : will do a simple ping test to see if the server is reachable.
MQTTSubscribe: setsup a subscription to a mqtt server - hides the drudgery of mqtt commands in a closure for the client it supplies the configuration options and waits on a callback to receive the message payload on the return side it has stop call which can stop the listener task from running.
No description provided by the author
RabbitDirectXchnge : middleware handler can connect to rabbit mq and inject aqmp ch and cnnection in context server : server hostname with port user pass : connecting credentials name of the xchange.
ReadK8SecretMount : reads a single secret given the mount path for the secret Handy function when reading secrets and deployment.
SafeCloseChn : channels need to be closed once, this can help to do that not more than once closure here deals with closing a channnel safely once using a niladic function when a channel has multiple points from where its closed, these multiple points cannot be predicted as in sequence.
SendOverUnixSocket : starts a task that when receives a message on a channel can dispatch a message on socket.
SetUpLog : here this is set up the most vanilla log preferences to get any module started Once upon the program exit return function can help close the log file if its not nil For most of thhe projects that we do here at eensymachines such logging setup in quite useful.
SysSignalListener : sets up a listener to the system signals and when the signal actually occurs this will indicate by closing the cancel channel We intend to make a closure of this sort so that we can re-use the same.

# Structs

Mongo connection using mongo connection params */.

# Interfaces

MongoConnectInfo: unified common interface that lets you connect to mongo irespective of how you choose the connection params.

# Type aliases

FileAction : callback from the Watcher everytime file change is detected.
Mongo connection using the complete connection string */.