Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = FreepsMqttConfig{Server: "", Username: "", Password: "", Topics: []TopicConfig{DefaultTopicConfig}}
View Source
var DefaultTopicConfig = TopicConfig{Topic: "#", Qos: 0, MeasurementIndex: -1, FieldIndex: -1, Fields: map[string]FieldConfig{}, TemplateToCall: "mqttaction"}
Functions ¶
This section is empty.
Types ¶
type ButtonWrapper ¶ added in v0.9.1
type ButtonWrapper struct { Button tgbotapi.InlineKeyboardButton Choice string }
type FieldConfig ¶
type FieldWithType ¶
type FreepsMqtt ¶
type FreepsMqtt struct { Config *FreepsMqttConfig Doer *freepsdo.TemplateMod Callback func(string, map[string]string, map[string]interface{}) error // contains filtered or unexported fields }
func NewMqttSubscriber ¶
func NewMqttSubscriber(cr *utils.ConfigReader, doer *freepsdo.TemplateMod) *FreepsMqtt
func (*FreepsMqtt) Shutdown ¶
func (fm *FreepsMqtt) Shutdown()
type FreepsMqttConfig ¶
type FreepsMqttConfig struct { Server string // The full url of the MQTT server to connect to ex: tcp://127.0.0.1:1883 Username string // A username to authenticate to the MQTT server Password string // Password to match username Topics []TopicConfig }
type HTMLUI ¶ added in v0.9.1
type HTMLUI struct {
// contains filtered or unexported fields
}
func NewHTMLUI ¶ added in v0.9.1
func NewHTMLUI(modinator *freepsdo.TemplateMod) *HTMLUI
NewHTMLUI creates a UI interface based on the inline template above
type JsonArgs ¶
type JsonArgs struct { Measurement string FieldsWithType map[string]FieldWithType }
type Restonator ¶
type Restonator struct { Modinator *freepsdo.TemplateMod // contains filtered or unexported fields }
func NewRestEndpoint ¶
func NewRestEndpoint(cr *utils.ConfigReader, doer *freepsdo.TemplateMod, cancel context.CancelFunc) *Restonator
func (*Restonator) ServeHTTP ¶
func (r *Restonator) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*Restonator) Shutdown ¶
func (r *Restonator) Shutdown(ctx context.Context)
type TelegramCallbackResponse ¶ added in v0.9.1
type Telegraminator ¶ added in v0.9.1
type Telegraminator struct { Modinator *freepsdo.TemplateMod // contains filtered or unexported fields }
func NewTelegramBot ¶ added in v0.9.1
func NewTelegramBot(cr *utils.ConfigReader, doer *freepsdo.TemplateMod, cancel context.CancelFunc) *Telegraminator
func (*Telegraminator) MainLoop ¶ added in v0.9.1
func (r *Telegraminator) MainLoop()
func (*Telegraminator) Respond ¶ added in v0.9.1
func (r *Telegraminator) Respond(chat *tgbotapi.Chat, callbackData string, inputText string)
func (*Telegraminator) Shutdown ¶ added in v0.9.1
func (r *Telegraminator) Shutdown(ctx context.Context)
type TemplateData ¶ added in v0.9.1
type TopicConfig ¶
type TopicConfig struct { Topic string // Topic to subscribe to Qos int // The QoS to subscribe to messages at // the topic string is split by slash; the values of the resulting array can be used as measurement and field - the index can be specified here MeasurementIndex int // index that points to the measurement in the topic-array FieldIndex int // index that points to the field in the topic-array Fields map[string]FieldConfig TemplateToCall string }
Click to show internal directories.
Click to hide internal directories.