Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitDurationData ¶
func InitDurationData()
InitDurationData - It takes care of starting all instances of DurationData
func RegisterInitDurationData ¶
func RegisterInitDurationData(f ...func() *DurationData)
RegisterInitDurationData - Records the functions that start their DurationData
Types ¶
type DDInterface ¶
type DDInterface interface {
HandlerData() (interface{}, error)
}
DDInterface - Interface to force implement the data handler
type DurationData ¶
type DurationData struct {
// contains filtered or unexported fields
}
DurationData - Struct to store the collected data with its relative expiration time, it is necessary to define a handler function to be assigned to the DurationData instance, a time interval in seconds in which the handler is called and then start the daemon relating to the same instance.
func (*DurationData) Daemon ¶
func (d *DurationData) Daemon()
Daemon - It takes care of starting the daemon that updates the data, it can be killed by calling the StopDaemon() func
func (*DurationData) GetSafeContent ¶
func (d *DurationData) GetSafeContent() interface{}
GetSafeContent - It exclusively returns the duration data content
func (*DurationData) SetDurationDataInterface ¶
func (d *DurationData) SetDurationDataInterface(ddi DDInterface)
SetDurationDataInterface - Set the struct that implements DDInterface
func (*DurationData) SetSafeContent ¶
func (d *DurationData) SetSafeContent(content interface{})
SetSafeContent - Set up your data securely
func (*DurationData) SetTimeToRefresh ¶
func (d *DurationData) SetTimeToRefresh(t int)
SetTimeToRefresh - Sets the value of the remote data refresh time
func (*DurationData) StopDaemon ¶
func (d *DurationData) StopDaemon()
StopDaemon - It takes care of warning the demon to stop