Documentation ¶
Index ¶
- Variables
- type ConfigMapCache
- func (c *ConfigMapCache) AddPoll(p *Poll) error
- func (c *ConfigMapCache) AddReminder(r *Reminder, user string) error
- func (c *ConfigMapCache) Delete(name string)
- func (c *ConfigMapCache) GetPoll(id, author string) *Poll
- func (c *ConfigMapCache) GetReminder(id, author string) *Reminder
- func (c *ConfigMapCache) ListPolls() map[string]Poll
- func (c *ConfigMapCache) ListReminders() map[string]Reminder
- func (c *ConfigMapCache) UpdatePoll(p *Poll) error
- type Poll
- type Reminder
Constants ¶
This section is empty.
Variables ¶
View Source
var Client kubernetes.Interface
Functions ¶
This section is empty.
Types ¶
type ConfigMapCache ¶
type ConfigMapCache struct {
// contains filtered or unexported fields
}
var Cache *ConfigMapCache
Only create a single instance of config map cache
func NewConfigMapCache ¶
func NewConfigMapCache() *ConfigMapCache
Create a configmap cache backed by k8s.
func NewInMemConfigMapCache ¶
func NewInMemConfigMapCache(polls map[string]Poll, reminders map[string]Reminder) *ConfigMapCache
Create a configmap cache that is in-memory. Cache is lost if application closes.
func (*ConfigMapCache) AddPoll ¶
func (c *ConfigMapCache) AddPoll(p *Poll) error
Add a poll configmap, this in turn triggers the informer handler which adds it to the in-mem cache.
func (*ConfigMapCache) AddReminder ¶
func (c *ConfigMapCache) AddReminder(r *Reminder, user string) error
Add a reminder configmap, this in turn triggers the informer handler which adds it to the in-mem cache.
func (*ConfigMapCache) Delete ¶
func (c *ConfigMapCache) Delete(name string)
Delete the configmap from the cluster which in turn triggers
the delete handler to remove it from the in-mem cache
func (*ConfigMapCache) GetPoll ¶
func (c *ConfigMapCache) GetPoll(id, author string) *Poll
func (*ConfigMapCache) GetReminder ¶
func (c *ConfigMapCache) GetReminder(id, author string) *Reminder
func (*ConfigMapCache) ListPolls ¶
func (c *ConfigMapCache) ListPolls() map[string]Poll
Getter for polls in the cache
func (*ConfigMapCache) ListReminders ¶
func (c *ConfigMapCache) ListReminders() map[string]Reminder
Getter for reminders in the cache
func (*ConfigMapCache) UpdatePoll ¶
func (c *ConfigMapCache) UpdatePoll(p *Poll) error
type Poll ¶
Click to show internal directories.
Click to hide internal directories.