sailhome

package
v0.0.0-...-2ed13ab Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "sailhome"

Variables

View Source
var DefaultConfig = Config{}

DefaultConfig is the default configuration.

Functions

func IsNowBetweenStartTimeAndEndTime

func IsNowBetweenStartTimeAndEndTime(startTimeStr, endTimeStr string) error

func New

func New(config config.Config) (server.Plugin, error)

Types

type Config

type Config struct {
	DBSelect   string `yaml:"db_select"`
	SQLite     string `yaml:"sqlite"`
	PostgreSQL string `yaml:"postgresql"`

	Upstream Upstream `yaml:"upstream"`
}

Config is the configuration for the sailhome plugin.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration, and return an error if it is invalid.

type JwtPayload

type JwtPayload struct {
	ClientId string
	Username string
}

func (*JwtPayload) Valid

func (p *JwtPayload) Valid() error

type SailHome

type SailHome struct {
	// contains filtered or unexported fields
}

func (*SailHome) ConnectionLostHandler

func (s *SailHome) ConnectionLostHandler(client mqtt.Client, err error)

func (*SailHome) DefaultPublishHandler

func (s *SailHome) DefaultPublishHandler(client mqtt.Client, msg mqtt.Message)

func (*SailHome) HookWrapper

func (s *SailHome) HookWrapper() server.HookWrapper

func (*SailHome) Load

func (s *SailHome) Load(service server.Server) error

func (*SailHome) Name

func (s *SailHome) Name() string

func (*SailHome) OnBasicAuthWrapper

func (s *SailHome) OnBasicAuthWrapper(pre server.OnBasicAuth) server.OnBasicAuth

func (*SailHome) OnConnectHandler

func (s *SailHome) OnConnectHandler(client mqtt.Client)

func (*SailHome) OnEnhancedAuthWrapper

func (s *SailHome) OnEnhancedAuthWrapper(pre server.OnEnhancedAuth) server.OnEnhancedAuth

func (*SailHome) OnMsgArrivedWrapper

func (s *SailHome) OnMsgArrivedWrapper(pre server.OnMsgArrived) server.OnMsgArrived

func (*SailHome) OnReAuthWrapper

func (s *SailHome) OnReAuthWrapper(pre server.OnReAuth) server.OnReAuth

func (*SailHome) OnSubscribeWrapper

func (s *SailHome) OnSubscribeWrapper(pre server.OnSubscribe) server.OnSubscribe

func (*SailHome) SendToCloud

func (s *SailHome) SendToCloud(topic string, qos uint8, retain bool, payload []byte) error

func (*SailHome) Unload

func (s *SailHome) Unload() error

type Upstream

type Upstream struct {
	UpstreamEnable    bool   `yaml:"upstream_enable"`
	UpstreamBrokerUri string `yaml:"upstream_broker_uri"`
	ClientId          string `yaml:"client_id"`
	UserName          string `yaml:"user_name"`
	Password          string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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