Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type ConfigDS18B20
- type ConfigGPIO
- type ConfigHeater
- type ConfigPT100
- type DS18B20Client
- type DSError
- type DSHandler
- func (d *DSHandler) Close()
- func (d *DSHandler) GetConfig(id string) (DSSensorConfig, error)
- func (d *DSHandler) GetSensors() []DSSensorConfig
- func (d *DSHandler) GetTemperatures() []DSTemperature
- func (d *DSHandler) Open()
- func (d *DSHandler) SetConfig(cfg DSSensorConfig) (newConfig DSSensorConfig, err error)
- func (d *DSHandler) Temperature(cfg ds18b20.SensorConfig) (float64, float64, error)
- type DSRPCClient
- type DSSensor
- type DSSensorConfig
- type DSTemperature
- type Embedded
- type Error
- type GPIO
- type GPIOClient
- type GPIOConfig
- type GPIOError
- type GPIOHandler
- type GPIORPCClient
- type Heater
- type HeaterClient
- type HeaterConfig
- type HeaterError
- type HeaterHandler
- func (h *HeaterHandler) Close()
- func (h *HeaterHandler) ConfigBy(id string) (HeaterConfig, error)
- func (h *HeaterHandler) Enable(id string, ena bool) error
- func (h *HeaterHandler) Get() []HeaterConfig
- func (h *HeaterHandler) Open()
- func (h *HeaterHandler) Power(id string, pwr uint) error
- func (h *HeaterHandler) SetConfig(cfg HeaterConfig) error
- type HeaterRPCClient
- type Option
- type PTClient
- type PTError
- type PTHandler
- func (p *PTHandler) Close() []error
- func (p *PTHandler) GetConfig(id string) (PTSensorConfig, error)
- func (p *PTHandler) GetSensors() []PTSensorConfig
- func (p *PTHandler) GetTemperatures() []PTTemperature
- func (p *PTHandler) Open()
- func (p *PTHandler) SetConfig(cfg PTSensorConfig) (newCfg PTSensorConfig, err error)
- type PTRPCClient
- type PTSensor
- type PTSensorConfig
- type PTTemperature
- type RPC
- func (r *RPC) Close()
- func (r *RPC) DSConfigure(ctx context.Context, config *embeddedproto.DSConfig) (*embeddedproto.DSConfig, error)
- func (r *RPC) DSGet(ctx context.Context, e *empty.Empty) (*embeddedproto.DSConfigs, error)
- func (r *RPC) DSGetTemperatures(ctx context.Context, e *empty.Empty) (*embeddedproto.DSTemperatures, error)
- func (r *RPC) GPIOConfigure(c context.Context, cfg *embeddedproto.GPIOConfig) (*embeddedproto.GPIOConfig, error)
- func (r *RPC) GPIOGet(ctx context.Context, empty *empty.Empty) (*embeddedproto.GPIOConfigs, error)
- func (r *RPC) HeaterConfigure(ctx context.Context, config *embeddedproto.HeaterConfig) (*embeddedproto.HeaterConfig, error)
- func (r *RPC) HeaterGet(context.Context, *empty.Empty) (*embeddedproto.HeaterConfigs, error)
- func (r *RPC) PTConfigure(ctx context.Context, config *embeddedproto.PTConfig) (*embeddedproto.PTConfig, error)
- func (r *RPC) PTGet(ctx context.Context, e *empty.Empty) (*embeddedproto.PTConfigs, error)
- func (r *RPC) PTGetTemperatures(ctx context.Context, e *empty.Empty) (*embeddedproto.PTTemperatures, error)
- func (r *RPC) Run() error
- type Rest
Constants ¶
View Source
const ( RoutesGetHeaters = "/api/heater" RoutesConfigHeater = "/api/heater" RoutesGetOnewireSensors = "/api/onewire" RoutesGetOnewireTemperatures = "/api/onewire/temperatures" RoutesConfigOnewireSensor = "/api/onewire" RoutesGetPT100Sensors = "/api/pt100" RoutesGetPT100Temperatures = "/api/pt100/temperatures" RoutesConfigPT100Sensor = "/api/pt100" RoutesGetGPIOs = "/api/gpio" RoutesConfigGPIO = "/api/gpio" )
Variables ¶
View Source
var ( ErrNoSuchID = errors.New("specified ID doesnt' exist") ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Heaters []ConfigHeater `mapstructure:"heaters"` DS18B20 []ConfigDS18B20 `mapstructure:"ds18b20"` PT100 []ConfigPT100 `mapstructure:"pt_100"` GPIO []ConfigGPIO `mapstructure:"gpio"` }
type ConfigDS18B20 ¶
type ConfigGPIO ¶
type ConfigHeater ¶
type ConfigHeater struct { ID string `mapstructure:"hardware_id"` Pin gpio.Pin `mapstructure:"gpio_pin"` ActiveLevel gpio.ActiveLevel `mapstructure:"active_level"` }
type ConfigPT100 ¶
type DS18B20Client ¶
type DS18B20Client struct {
// contains filtered or unexported fields
}
func NewDS18B20Client ¶
func NewDS18B20Client(addr string, timeout time.Duration) *DS18B20Client
func (*DS18B20Client) Configure ¶
func (p *DS18B20Client) Configure(setConfig DSSensorConfig) (DSSensorConfig, error)
func (*DS18B20Client) Get ¶
func (p *DS18B20Client) Get() ([]DSSensorConfig, error)
func (*DS18B20Client) Temperatures ¶
func (p *DS18B20Client) Temperatures() ([]DSTemperature, error)
type DSHandler ¶
type DSHandler struct {
// contains filtered or unexported fields
}
func (*DSHandler) GetSensors ¶
func (d *DSHandler) GetSensors() []DSSensorConfig
func (*DSHandler) GetTemperatures ¶
func (d *DSHandler) GetTemperatures() []DSTemperature
func (*DSHandler) SetConfig ¶
func (d *DSHandler) SetConfig(cfg DSSensorConfig) (newConfig DSSensorConfig, err error)
func (*DSHandler) Temperature ¶
type DSRPCClient ¶
type DSRPCClient struct {
// contains filtered or unexported fields
}
func NewDSRPCClient ¶
func NewDSRPCClient(addr string, timeout time.Duration) (*DSRPCClient, error)
func (*DSRPCClient) Close ¶
func (g *DSRPCClient) Close()
func (*DSRPCClient) Configure ¶
func (g *DSRPCClient) Configure(setConfig DSSensorConfig) (DSSensorConfig, error)
func (*DSRPCClient) Get ¶
func (g *DSRPCClient) Get() ([]DSSensorConfig, error)
func (*DSRPCClient) Temperatures ¶
func (g *DSRPCClient) Temperatures() ([]DSTemperature, error)
type DSSensorConfig ¶
type DSSensorConfig struct { Enabled bool `json:"enabled"` ds18b20.SensorConfig }
type DSTemperature ¶
type Embedded ¶
type Embedded struct { Heaters *HeaterHandler DS *DSHandler PT *PTHandler GPIO *GPIOHandler }
type Error ¶
type Error struct { Title string `json:"title"` Detail string `json:"detail"` Instance string `json:"instance"` Timestamp time.Time `json:"timestamp"` }
Error is common struct returned via rest api
type GPIOClient ¶
type GPIOClient struct {
// contains filtered or unexported fields
}
func NewGPIOClient ¶
func NewGPIOClient(addr string, timeout time.Duration) *GPIOClient
func (*GPIOClient) Configure ¶
func (p *GPIOClient) Configure(setConfig GPIOConfig) (GPIOConfig, error)
func (*GPIOClient) Get ¶
func (p *GPIOClient) Get() ([]GPIOConfig, error)
type GPIOConfig ¶
type GPIOHandler ¶
type GPIOHandler struct {
// contains filtered or unexported fields
}
func (*GPIOHandler) Close ¶
func (g *GPIOHandler) Close()
func (*GPIOHandler) GetConfig ¶
func (g *GPIOHandler) GetConfig(id string) (GPIOConfig, error)
func (*GPIOHandler) GetConfigAll ¶
func (g *GPIOHandler) GetConfigAll() ([]GPIOConfig, error)
func (*GPIOHandler) Open ¶
func (g *GPIOHandler) Open()
func (*GPIOHandler) SetConfig ¶
func (g *GPIOHandler) SetConfig(cfg GPIOConfig) error
type GPIORPCClient ¶
type GPIORPCClient struct {
// contains filtered or unexported fields
}
func NewGPIORPCClient ¶
func NewGPIORPCClient(addr string, timeout time.Duration) (*GPIORPCClient, error)
func (*GPIORPCClient) Close ¶
func (g *GPIORPCClient) Close()
func (*GPIORPCClient) Configure ¶
func (g *GPIORPCClient) Configure(setConfig GPIOConfig) (GPIOConfig, error)
func (*GPIORPCClient) Get ¶
func (g *GPIORPCClient) Get() ([]GPIOConfig, error)
type HeaterClient ¶
type HeaterClient struct {
// contains filtered or unexported fields
}
func NewHeaterClient ¶
func NewHeaterClient(addr string, timeout time.Duration) *HeaterClient
func (*HeaterClient) Configure ¶
func (p *HeaterClient) Configure(setConfig HeaterConfig) (HeaterConfig, error)
func (*HeaterClient) Get ¶
func (p *HeaterClient) Get() ([]HeaterConfig, error)
type HeaterConfig ¶
type HeaterError ¶
func (*HeaterError) Error ¶
func (e *HeaterError) Error() string
type HeaterHandler ¶
type HeaterHandler struct {
// contains filtered or unexported fields
}
func (*HeaterHandler) Close ¶
func (h *HeaterHandler) Close()
func (*HeaterHandler) ConfigBy ¶
func (h *HeaterHandler) ConfigBy(id string) (HeaterConfig, error)
func (*HeaterHandler) Get ¶
func (h *HeaterHandler) Get() []HeaterConfig
func (*HeaterHandler) Open ¶
func (h *HeaterHandler) Open()
func (*HeaterHandler) SetConfig ¶
func (h *HeaterHandler) SetConfig(cfg HeaterConfig) error
type HeaterRPCClient ¶
type HeaterRPCClient struct {
// contains filtered or unexported fields
}
func NewHeaterRPCCLient ¶
func NewHeaterRPCCLient(addr string, timeout time.Duration) (*HeaterRPCClient, error)
func (*HeaterRPCClient) Close ¶
func (g *HeaterRPCClient) Close()
func (*HeaterRPCClient) Configure ¶
func (g *HeaterRPCClient) Configure(setConfig HeaterConfig) (HeaterConfig, error)
func (*HeaterRPCClient) Get ¶
func (g *HeaterRPCClient) Get() ([]HeaterConfig, error)
type PTClient ¶
type PTClient struct {
// contains filtered or unexported fields
}
func (*PTClient) Configure ¶
func (p *PTClient) Configure(setConfig PTSensorConfig) (PTSensorConfig, error)
func (*PTClient) Get ¶
func (p *PTClient) Get() ([]PTSensorConfig, error)
func (*PTClient) Temperatures ¶
func (p *PTClient) Temperatures() ([]PTTemperature, error)
type PTHandler ¶
type PTHandler struct {
// contains filtered or unexported fields
}
PTHandler is responsible for handling models.PTSensors
func (*PTHandler) GetSensors ¶
func (p *PTHandler) GetSensors() []PTSensorConfig
func (*PTHandler) GetTemperatures ¶
func (p *PTHandler) GetTemperatures() []PTTemperature
func (*PTHandler) SetConfig ¶
func (p *PTHandler) SetConfig(cfg PTSensorConfig) (newCfg PTSensorConfig, err error)
type PTRPCClient ¶
type PTRPCClient struct {
// contains filtered or unexported fields
}
func NewPTRPCClient ¶
func NewPTRPCClient(addr string, timeout time.Duration) (*PTRPCClient, error)
func (*PTRPCClient) Close ¶
func (g *PTRPCClient) Close()
func (*PTRPCClient) Configure ¶
func (g *PTRPCClient) Configure(setConfig PTSensorConfig) (PTSensorConfig, error)
func (*PTRPCClient) Get ¶
func (g *PTRPCClient) Get() ([]PTSensorConfig, error)
func (*PTRPCClient) Temperatures ¶
func (g *PTRPCClient) Temperatures() ([]PTTemperature, error)
type PTSensorConfig ¶
type PTSensorConfig struct { Enabled bool `json:"enabled"` max31865.SensorConfig }
type PTTemperature ¶
type RPC ¶
type RPC struct { embeddedproto.UnimplementedPTServer embeddedproto.UnimplementedHeaterServer embeddedproto.UnimplementedDSServer embeddedproto.UnimplementedGPIOServer *Embedded // contains filtered or unexported fields }
func (*RPC) DSConfigure ¶
func (r *RPC) DSConfigure(ctx context.Context, config *embeddedproto.DSConfig) (*embeddedproto.DSConfig, error)
func (*RPC) DSGetTemperatures ¶
func (r *RPC) DSGetTemperatures(ctx context.Context, e *empty.Empty) (*embeddedproto.DSTemperatures, error)
func (*RPC) GPIOConfigure ¶
func (r *RPC) GPIOConfigure(c context.Context, cfg *embeddedproto.GPIOConfig) (*embeddedproto.GPIOConfig, error)
func (*RPC) GPIOGet ¶
func (r *RPC) GPIOGet(ctx context.Context, empty *empty.Empty) (*embeddedproto.GPIOConfigs, error)
func (*RPC) HeaterConfigure ¶
func (r *RPC) HeaterConfigure(ctx context.Context, config *embeddedproto.HeaterConfig) (*embeddedproto.HeaterConfig, error)
func (*RPC) HeaterGet ¶
func (r *RPC) HeaterGet(context.Context, *empty.Empty) (*embeddedproto.HeaterConfigs, error)
func (*RPC) PTConfigure ¶
func (r *RPC) PTConfigure(ctx context.Context, config *embeddedproto.PTConfig) (*embeddedproto.PTConfig, error)
func (*RPC) PTGetTemperatures ¶
func (r *RPC) PTGetTemperatures(ctx context.Context, e *empty.Empty) (*embeddedproto.PTTemperatures, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.