Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { GetValue func() interface{} Delay time.Duration NextUpdate time.Time sync.RWMutex // contains filtered or unexported fields }
Cache implements a thread-safe cache for polling resources.
func HTTPResponse ¶
func HTTPResponse(rq *http.Request, process func(b []byte) interface{}, client *http.Client, t time.Duration) *Cache
HTTPResponse is a convenience function that makes the http request rq periodically and processes the response with 'process'.
Click to show internal directories.
Click to hide internal directories.