durationdata

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2020 License: MIT Imports: 2 Imported by: 3

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL