Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶
type ConfigMap struct {
// contains filtered or unexported fields
}
ConfigMap is an implementation of koanf.Provider that reads/loads configuration from a ConfigMap. ConfigMap is capable of watching the ConfigMap in Kubernetes for changes and notifying via a callback.
func ConfigMapProvider ¶
func ConfigMapProvider(k8sClient *kubernetes.Clientset, cmName, cmNamespace string) *ConfigMap
ConfigMapProvider creates and returns a ConfigFile instance to read and watch a ConfigMap in Kubernetes.
func (*ConfigMap) Close ¶
func (c *ConfigMap) Close()
Close gracefully closes a ConfigMap watch if Watch was called. Otherwise, it is a no-op.
func (*ConfigMap) ReadBytes ¶
ReadBytes is not supported by ConfigMap and will always return an error.
func (*ConfigMap) Watch ¶
Watch sets up a listener to monitor changes in the ConfigMap and invokes the callback upon add or update events. It ensures the method can only be invoked once and blocks until the cache syncs successfully. Returns an error if the watch activation fails or cache synchronization times out.
type ConfigMapFile ¶
type ConfigMapFile struct {
// contains filtered or unexported fields
}
ConfigMapFile is an implementation of koanf.Provider that reads/loads a config file stored inside a configmap as a key. ConfigMapFile is capable of watching the ConfigMap in Kubernetes for changes and notifying via a callback.
func ConfigMapFileProvider ¶
func ConfigMapFileProvider(k8sClient *kubernetes.Clientset, cmName, cmNamespace, key string) *ConfigMapFile
ConfigMapFileProvider creates and returns a ConfigMapFile instance to read and watch a ConfigMap in Kubernetes.
func (*ConfigMapFile) Close ¶
func (c *ConfigMapFile) Close()
Close gracefully closes a ConfigMap watch if Watch was called. Otherwise, it is a no-op.
func (*ConfigMapFile) Read ¶
func (c *ConfigMapFile) Read() (map[string]interface{}, error)
Read is not supported by ConfigMapFile and will always return an error.
func (*ConfigMapFile) ReadBytes ¶
func (c *ConfigMapFile) ReadBytes() ([]byte, error)
ReadBytes reads and returns the contents of a configuration file stored in a Kubernetes ConfigMap.
func (*ConfigMapFile) Watch ¶
func (c *ConfigMapFile) Watch(cb func(event interface{}, err error)) error
Watch sets up a listener to monitor changes in the ConfigMap and invokes the callback upon add or update events. It ensures the method can only be invoked once and blocks until the cache syncs successfully. Returns an error if the watch activation fails or cache synchronization times out.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an implementation of koanf.Provider that reads/loads configuration from a file. File is also capable of watching for changes to the configured file and invoking a callback when changes are detected.
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
MongoDB is an implementation of koanf.Provider that reads/loads configuration stored in a Document in MongoDB.
func MongoDBProvider ¶
MongoDBProvider initializes and returns a new MongoDB instance.
func (*MongoDB) Close ¶
Close terminates the MongoDB change stream if active and returns any encountered error during closure.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis is an implementation of koanf.Provider that reads/loads configuration stored in Redis as a STRING type. Redis is capable of watching a key in Redis and notifying changes via a callback.
func RedisProvider ¶
RedisProvider initializes and returns a new instance if Redis.