Documentation ¶
Index ¶
- Constants
- func LoadStatus(conn redis.Conn, redisKey string) []pingd.HostStatus
- func NewLoaderFunc(redisAddr string, redisDB int, listKey string) pingd.Loader
- func NewNotifierFunc(redisAddr string, redisDB int, upKey, downKey string) pingd.Notifier
- func NewReceiverFunc(redisAddr string, redisDB int, startKey, stopKey, listKey string) pingd.Receiver
- func NewRedisConn(redisAddr string, redisDB int, purpose string) redis.Conn
- func StartRedisHost(connKV redis.Conn, listKey, host string, startHostCh chan<- pingd.HostStatus)
- func StopRedisHost(connKV redis.Conn, listKey, host string, stopHostCh chan<- pingd.HostStatus)
Constants ¶
View Source
const (
StatusPrefix = "status-"
)
Variables ¶
This section is empty.
Functions ¶
func LoadStatus ¶
func LoadStatus(conn redis.Conn, redisKey string) []pingd.HostStatus
func NewLoaderFunc ¶
NewLoaderFunc returns the function that loads back hosts and last statuses from REDIS in case of reboot send them to the startHostCh channel
func NewNotifierFunc ¶
NewNotifierFunc returns the function that publishes on redis the up/down events
func NewReceiverFunc ¶
func NewReceiverFunc(redisAddr string, redisDB int, startKey, stopKey, listKey string) pingd.Receiver
NewReceiverFunc returns the function that listens of redis for start/stop commands
func StartRedisHost ¶
func StartRedisHost(connKV redis.Conn, listKey, host string, startHostCh chan<- pingd.HostStatus)
func StopRedisHost ¶
func StopRedisHost(connKV redis.Conn, listKey, host string, stopHostCh chan<- pingd.HostStatus)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.