config

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map(cm *corev1.ConfigMap, obj interface{})

Map maps the given object fields with the given ConfigMap data items.

Types

type AddNotifiable

type AddNotifiable interface {
	NotifyAdd(*corev1.ConfigMap)
}

type Config

type Config struct {
	ServerAddress       string
	PublishHost         string        `config:"publish_host"`
	MaxIdleConns        int           `config:"max_idle_conns"`
	MaxConnsPerHost     int           `config:"max_conns_per_host"`
	MaxIdleConnsPerHost int           `config:"max_idle_conns_per_host"`
	IdleConnTimeout     time.Duration `config:"idle_conn_timeout"`
}

Config represents environment config.

func New

func New() *Config

func (*Config) String

func (c *Config) String() string

type DeleteNotifiable

type DeleteNotifiable interface {
	NotifyDelete(*corev1.ConfigMap)
}

type Notifiable

type Notifiable interface {
	AddNotifiable
	UpdateNotifiable
	DeleteNotifiable
}

type UpdateNotifiable

type UpdateNotifiable interface {
	NotifyUpdate(*corev1.ConfigMap)
}

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(client kubernetes.Interface, namespace, name string) *Watcher

func (*Watcher) NotifyDelete

func (w *Watcher) NotifyDelete(*corev1.ConfigMap)

func (*Watcher) OnAddNotify

func (w *Watcher) OnAddNotify(notifiable AddNotifiable) *Watcher

func (*Watcher) OnDeleteNotify

func (w *Watcher) OnDeleteNotify(notifiable DeleteNotifiable) *Watcher

func (*Watcher) OnDeleteNotifyMe

func (w *Watcher) OnDeleteNotifyMe() *Watcher

func (*Watcher) OnUpdateNotify

func (w *Watcher) OnUpdateNotify(notifiable UpdateNotifiable) *Watcher

func (*Watcher) Watch

func (w *Watcher) Watch()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL