Documentation ¶
Overview ¶
Package memory provides an in-memory volatile config store implementation
Index ¶
- Constants
- func Make(schemas collection.Schemas) model.ConfigStore
- func MakeSkipValidation(schemas collection.Schemas) model.ConfigStore
- type ConfigEvent
- type Controller
- func (c *Controller) Create(config config.Config) (revision string, err error)
- func (c *Controller) Delete(kind config.GroupVersionKind, key, namespace string, resourceVersion *string) error
- func (c *Controller) Get(kind config.GroupVersionKind, key, namespace string) *config.Config
- func (c *Controller) HasSynced() bool
- func (c *Controller) List(kind config.GroupVersionKind, namespace string) []config.Config
- func (c *Controller) Patch(orig config.Config, patchFn config.PatchFunc) (newRevision string, err error)
- func (c *Controller) RegisterEventHandler(kind config.GroupVersionKind, f model.EventHandler)
- func (c *Controller) RegisterHasSyncedHandler(cb func() bool)
- func (c *Controller) Run(stop <-chan struct{})
- func (c *Controller) Schemas() collection.Schemas
- func (c *Controller) Update(config config.Config) (newRevision string, err error)
- func (c *Controller) UpdateStatus(config config.Config) (newRevision string, err error)
- type Handler
- type Monitor
Constants ¶
const (
// BufferSize specifies the buffer size of event channel
BufferSize = 100
)
const ResourceVersion string = "ResourceVersion"
Variables ¶
This section is empty.
Functions ¶
func Make ¶
func Make(schemas collection.Schemas) model.ConfigStore
Make creates an in-memory config store from a config schemas It is with validation
func MakeSkipValidation ¶
func MakeSkipValidation(schemas collection.Schemas) model.ConfigStore
MakeSkipValidation creates an in-memory config store from a config schemas It is without validation
Types ¶
type ConfigEvent ¶
type ConfigEvent struct {
// contains filtered or unexported fields
}
ConfigEvent defines the event to be processed
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is an implementation of ConfigStoreController.
func NewController ¶
func NewController(cs model.ConfigStore) *Controller
NewController return an implementation of ConfigStoreController This is a client-side monitor that dispatches events as the changes are being made on the client.
func NewSyncController ¶
func NewSyncController(cs model.ConfigStore) *Controller
NewSyncController return an implementation of model.ConfigStoreController which processes events synchronously
func (*Controller) Create ¶
func (c *Controller) Create(config config.Config) (revision string, err error)
func (*Controller) Delete ¶
func (c *Controller) Delete(kind config.GroupVersionKind, key, namespace string, resourceVersion *string) error
func (*Controller) Get ¶
func (c *Controller) Get(kind config.GroupVersionKind, key, namespace string) *config.Config
func (*Controller) HasSynced ¶
func (c *Controller) HasSynced() bool
HasSynced return whether store has synced It can be controlled externally (such as by the data source), otherwise it'll always consider synced.
func (*Controller) List ¶
func (c *Controller) List(kind config.GroupVersionKind, namespace string) []config.Config
func (*Controller) RegisterEventHandler ¶
func (c *Controller) RegisterEventHandler(kind config.GroupVersionKind, f model.EventHandler)
func (*Controller) RegisterHasSyncedHandler ¶
func (c *Controller) RegisterHasSyncedHandler(cb func() bool)
func (*Controller) Run ¶
func (c *Controller) Run(stop <-chan struct{})
func (*Controller) Schemas ¶
func (c *Controller) Schemas() collection.Schemas
func (*Controller) Update ¶
func (c *Controller) Update(config config.Config) (newRevision string, err error)
func (*Controller) UpdateStatus ¶
func (c *Controller) UpdateStatus(config config.Config) (newRevision string, err error)
type Monitor ¶
type Monitor interface { Run(<-chan struct{}) AppendEventHandler(config2.GroupVersionKind, Handler) ScheduleProcessEvent(ConfigEvent) }
Monitor provides methods of manipulating changes in the config store
func NewMonitor ¶
func NewMonitor(store model.ConfigStore) Monitor
NewMonitor returns new Monitor implementation with a default event buffer size.
func NewSyncMonitor ¶
func NewSyncMonitor(store model.ConfigStore) Monitor
NewMonitor returns new Monitor implementation which will process events synchronously