Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { Name string `json:"name,omitempty"` // The name of the option. Used as default for OptionSource.Value Key string `json:"key,omitempty"` // The mode name, defaults to Root.Modes key. e.g. "occupancy". Used as default for OptionSource.Mode Value string `json:"value,omitempty"` // The value used by this option, defaults to Option.Name. e.g. "occupied Sources []SourceOrString `json:"sources,omitempty"` }
type OptionSource ¶
type Root ¶
func ReadConfigBytes ¶
func (Root) AllDeviceNames ¶
func (*Root) Hydrate ¶
func (r *Root) Hydrate()
Hydrate fills defaults with their actual values. Called as part of ReadConfig. r is modified in place, each OptionSource will have its Mode and Value set based on the Modes key or Option.Name.
type SourceOrString ¶
type SourceOrString struct {
OptionSource
}
SourceOrString is like OptionSource but for simple cases like `{"devices": ["foo"]}` un/marshals from/to `"foo"`.
func (SourceOrString) MarshalJSON ¶
func (m SourceOrString) MarshalJSON() ([]byte, error)
func (*SourceOrString) UnmarshalJSON ¶
func (m *SourceOrString) UnmarshalJSON(bytes []byte) error
Click to show internal directories.
Click to hide internal directories.