Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoConnection = errors.New("no connection to broker server")
Functions ¶
This section is empty.
Types ¶
type MQTTBroker ¶
type MQTTBroker struct {
// contains filtered or unexported fields
}
MQTTBroker implements broker.Broker interface.
func NewBroker ¶
func NewBroker(opts ...Option) (*MQTTBroker, error)
NewBroker creates new mqtt broker.
func (*MQTTBroker) Connect ¶
func (m *MQTTBroker) Connect() error
func (*MQTTBroker) Disconnect ¶
func (m *MQTTBroker) Disconnect() error
func (*MQTTBroker) Publish ¶
func (m *MQTTBroker) Publish(topic string, payload interface{}) error
func (*MQTTBroker) String ¶
func (m *MQTTBroker) String() string
type Option ¶
type Option func(m *MQTTBroker) error
func WithClientID ¶
WitClientID returns an Option which set the broker client id.
func WithPassword ¶
WithPassword returns an Option which set the password use to connect to server.
func WithUsername ¶
WithUsername returns an Option which set the username use to connect to server.
Click to show internal directories.
Click to hide internal directories.