Documentation ¶
Index ¶
- Variables
- func CompareIdentity(cfg1 Config, cfg2 Config) bool
- type BoolProperty
- type Callback
- type ChainedBoolProperty
- type ChainedDurationProperty
- type ChainedIntProperty
- type ChainedStringProperty
- type ChangeEvent
- type Config
- type DurationProperty
- type DynamicBoolProperty
- type DynamicConfig
- type DynamicDurationProperty
- type DynamicIntProperty
- type DynamicProperty
- type DynamicStringProperty
- type Event
- type EventHandler
- type IntProperty
- type LayeredConfig
- func (c *LayeredConfig) Add(cfg DynamicConfig) int
- func (c *LayeredConfig) AddAtIndex(cfg DynamicConfig, index int) int
- func (c *LayeredConfig) GetProperty(name string) (string, bool)
- func (c *LayeredConfig) HasProperty(name string) bool
- func (c *LayeredConfig) RemoveProperty(name string)
- func (c *LayeredConfig) SetProperty(name string, value string)
- type MapConfig
- type Observable
- type Property
- type PropertyFactory
- func (f *PropertyFactory) GetBoolProperty(name string, defaultValue bool) BoolProperty
- func (f *PropertyFactory) GetDurationProperty(name string, defaultValue time.Duration, unit time.Duration) DurationProperty
- func (f *PropertyFactory) GetIntProperty(name string, defaultValue int) IntProperty
- func (f *PropertyFactory) GetStringProperty(name, defaultValue string) StringProperty
- type StringProperty
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoValue = errors.New("no property value") InvalidBoolValue = errors.New("invalid boolean value") )
View Source
var InvalidSubscribtion = errors.New("invalid subscription")
Functions ¶
func CompareIdentity ¶
Types ¶
type BoolProperty ¶
func NewChainedBoolProperty ¶
func NewChainedBoolProperty(f *PropertyFactory, name string, next BoolProperty) BoolProperty
type Callback ¶
type Callback func(e *ChangeEvent)
type ChainedBoolProperty ¶
type ChainedBoolProperty struct {
// contains filtered or unexported fields
}
func (*ChainedBoolProperty) Get ¶
func (p *ChainedBoolProperty) Get() bool
func (*ChainedBoolProperty) HasValue ¶
func (p *ChainedBoolProperty) HasValue() bool
func (*ChainedBoolProperty) Name ¶
func (p *ChainedBoolProperty) Name() string
type ChainedDurationProperty ¶
type ChainedDurationProperty struct {
// contains filtered or unexported fields
}
func (*ChainedDurationProperty) Get ¶
func (p *ChainedDurationProperty) Get() time.Duration
func (*ChainedDurationProperty) HasValue ¶
func (p *ChainedDurationProperty) HasValue() bool
func (*ChainedDurationProperty) Name ¶
func (p *ChainedDurationProperty) Name() string
type ChainedIntProperty ¶
type ChainedIntProperty struct {
// contains filtered or unexported fields
}
func (*ChainedIntProperty) Get ¶
func (p *ChainedIntProperty) Get() int
func (*ChainedIntProperty) HasValue ¶
func (p *ChainedIntProperty) HasValue() bool
func (*ChainedIntProperty) Name ¶
func (p *ChainedIntProperty) Name() string
type ChainedStringProperty ¶
type ChainedStringProperty struct {
// contains filtered or unexported fields
}
func (*ChainedStringProperty) Get ¶
func (p *ChainedStringProperty) Get() string
func (*ChainedStringProperty) HasValue ¶
func (p *ChainedStringProperty) HasValue() bool
func (*ChainedStringProperty) Name ¶
func (p *ChainedStringProperty) Name() string
type ChangeEvent ¶
type ChangeEvent struct {
// contains filtered or unexported fields
}
func NewChangeEvent ¶
func NewChangeEvent(source Config, event Event, name, value string) *ChangeEvent
func (*ChangeEvent) Event ¶
func (e *ChangeEvent) Event() Event
func (*ChangeEvent) Name ¶
func (e *ChangeEvent) Name() string
func (*ChangeEvent) Source ¶
func (e *ChangeEvent) Source() Config
func (*ChangeEvent) Value ¶
func (e *ChangeEvent) Value() string
type DurationProperty ¶
func NewChainedDurationProperty ¶
func NewChainedDurationProperty(f *PropertyFactory, name string, unit time.Duration, next DurationProperty) DurationProperty
type DynamicBoolProperty ¶
type DynamicBoolProperty struct {
// contains filtered or unexported fields
}
func (*DynamicBoolProperty) Get ¶
func (p *DynamicBoolProperty) Get() bool
func (*DynamicBoolProperty) HasValue ¶
func (p *DynamicBoolProperty) HasValue() bool
func (*DynamicBoolProperty) Name ¶
func (p *DynamicBoolProperty) Name() string
type DynamicConfig ¶
type DynamicConfig interface { Config Observable }
type DynamicDurationProperty ¶
type DynamicDurationProperty struct {
// contains filtered or unexported fields
}
func (*DynamicDurationProperty) Get ¶
func (p *DynamicDurationProperty) Get() time.Duration
func (*DynamicDurationProperty) HasValue ¶
func (p *DynamicDurationProperty) HasValue() bool
func (*DynamicDurationProperty) Name ¶
func (p *DynamicDurationProperty) Name() string
type DynamicIntProperty ¶
type DynamicIntProperty struct {
// contains filtered or unexported fields
}
func (*DynamicIntProperty) Get ¶
func (p *DynamicIntProperty) Get() int
func (*DynamicIntProperty) HasValue ¶
func (p *DynamicIntProperty) HasValue() bool
func (*DynamicIntProperty) Name ¶
func (p *DynamicIntProperty) Name() string
type DynamicProperty ¶
type DynamicProperty struct {
// contains filtered or unexported fields
}
func (*DynamicProperty) LastTimeChanged ¶
func (p *DynamicProperty) LastTimeChanged() time.Time
func (*DynamicProperty) Name ¶
func (p *DynamicProperty) Name() string
type DynamicStringProperty ¶
type DynamicStringProperty struct {
// contains filtered or unexported fields
}
func (*DynamicStringProperty) Get ¶
func (p *DynamicStringProperty) Get() string
func (*DynamicStringProperty) HasValue ¶
func (p *DynamicStringProperty) HasValue() bool
func (*DynamicStringProperty) Name ¶
func (p *DynamicStringProperty) Name() string
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func NewEventHandler ¶
func NewEventHandler() *EventHandler
func (*EventHandler) Notify ¶
func (h *EventHandler) Notify(e *ChangeEvent)
func (*EventHandler) Subscribe ¶
func (h *EventHandler) Subscribe(f Callback) subscription
func (*EventHandler) Unsubscribe ¶
func (h *EventHandler) Unsubscribe(s subscription) error
type IntProperty ¶
func NewChainedIntProperty ¶
func NewChainedIntProperty(f *PropertyFactory, name string, next IntProperty) IntProperty
type LayeredConfig ¶
type LayeredConfig struct { *EventHandler // contains filtered or unexported fields }
func NewLayeredConfig ¶
func NewLayeredConfig() *LayeredConfig
func (*LayeredConfig) Add ¶
func (c *LayeredConfig) Add(cfg DynamicConfig) int
func (*LayeredConfig) AddAtIndex ¶
func (c *LayeredConfig) AddAtIndex(cfg DynamicConfig, index int) int
func (*LayeredConfig) GetProperty ¶
func (c *LayeredConfig) GetProperty(name string) (string, bool)
func (*LayeredConfig) HasProperty ¶
func (c *LayeredConfig) HasProperty(name string) bool
func (*LayeredConfig) RemoveProperty ¶
func (c *LayeredConfig) RemoveProperty(name string)
func (*LayeredConfig) SetProperty ¶
func (c *LayeredConfig) SetProperty(name string, value string)
type MapConfig ¶
type MapConfig struct { *EventHandler // contains filtered or unexported fields }
func NewEmptyMapConfig ¶
func NewEmptyMapConfig() *MapConfig
func NewMapConfig ¶
func (*MapConfig) HasProperty ¶
func (*MapConfig) RemoveProperty ¶
func (*MapConfig) SetProperty ¶
type Observable ¶
type PropertyFactory ¶
type PropertyFactory struct {
// contains filtered or unexported fields
}
func NewPropertyFactory ¶
func NewPropertyFactory(owner DynamicConfig) *PropertyFactory
func (*PropertyFactory) GetBoolProperty ¶
func (f *PropertyFactory) GetBoolProperty(name string, defaultValue bool) BoolProperty
func (*PropertyFactory) GetDurationProperty ¶
func (f *PropertyFactory) GetDurationProperty(name string, defaultValue time.Duration, unit time.Duration) DurationProperty
func (*PropertyFactory) GetIntProperty ¶
func (f *PropertyFactory) GetIntProperty(name string, defaultValue int) IntProperty
func (*PropertyFactory) GetStringProperty ¶
func (f *PropertyFactory) GetStringProperty(name, defaultValue string) StringProperty
type StringProperty ¶
func NewChainedStringProperty ¶
func NewChainedStringProperty(f *PropertyFactory, name string, next StringProperty) StringProperty
Click to show internal directories.
Click to hide internal directories.