config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boblight added in v1.4.0

type Boblight struct {
	Input  *Host `json:"input"`  // Required
	Output *Host `json:"output"` // Required
}

Boblight stores the boblight json configuration structure

type Config

type Config struct {
	XBMC      *Host       `json:"xbmc"`      // Deprecated
	Kodi      *Host       `json:"kodi"`      // Required (if XBMC not provided)
	Hyperion  *Hyperion   `json:"hyperion"`  // Optional
	LIFX      *LIFX       `json:"lifx"`      // Optional
	Boblight  *Boblight   `json:"boblight"`  // Optional
	Debug     *bool       `json:"debug"`     // Optional
	Callbacks interface{} `json:"callbacks"` // Required
}

Config stores the json configuration structure.

func Load

func Load(filename string) Config

Load reads the configuration from the specified filename, and returns the decoded JSON data.

type Host added in v1.0.0

type Host struct {
	Address string   `json:"address"` // Required
	Port    uint16   `json:"port"`    // Required
	Timeout *Timeout `json:"timeout"` // Optional
}

Host contains the IP address, port and timeout for TCP/UDP connections.

type Hyperion added in v1.5.0

type Hyperion struct {
	Input  *Host `json:"input"`  // Optional
	Output *Host `json:"output"` // Required, unless legacy configuration
	*Host        // Embedded host to support legacy configuration
}

Hyperion stores the hyperion json configuration structure

type LIFX added in v1.1.0

type LIFX struct {
	Timeout *Timeout `json:"timeout"` // Optional
}

LIFX stores the LIFX json configuration structure.

type Timeout added in v1.1.0

type Timeout time.Duration

Timeout is a duration type that unmarshals from a JSON string

func (*Timeout) UnmarshalJSON added in v1.1.0

func (t *Timeout) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a time string into a time.Duration

Jump to

Keyboard shortcuts

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