Documentation
¶
Index ¶
Constants ¶
View Source
const (
RedisKeyRecentlyUpdatedWidgets = "recently_updated_widgets"
)
Variables ¶
View Source
var ErrorNotFound = errors.New("item not found in cache")
Functions ¶
func NewRedisCache ¶
func NewRedisCache(c *redis.Client) *redisCache
Types ¶
type RedisCache ¶
type RedisCache interface { GetWidget(serialNumber string) (*dto.Widget, error) // SetWidget puts widget meta data into the cache SetWidget(widget *dto.Widget) error // GetConnections retrieves the widget's connections from cache. GetConnections(serialNumber string) (*dto.WidgetConnections, error) // SetConnections updates the widget's connections with non zero sn peers in // provided conns object. SetConnections(conns *dto.WidgetConnections) error // UnsetConnections removes the widget's (and peers') connections from // cache. UnsetConnections(serialNumber string, ports dto.WidgetPortBitmap) error // RetrieveRecentUpdates returns up to numUpdates or more (SSCAN count // behaviour) of recent widget connection updates, removes the serial // numbers of retrieves widgets from recently_updated_widgets set. RetrieveRecentUpdates(numUpdates int) ([]*dto.WidgetConnections, error) }
Click to show internal directories.
Click to hide internal directories.