core

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

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package smqtt implements functions for manipulation of MQTT API. It provides a gin-like way to create MQTT API.

Package core provides way to send MQTT message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientError

func ClientError(err_str string) error

func InternalError

func InternalError(err_str string) error

func ParamRequiredError

func ParamRequiredError(param_name string) error

Types

type ClientConfig

type ClientConfig struct {
	Broker         string
	ClientId       string
	CaCertPath     string
	ClientCertPath string
	ClientKeyPath  string
	KeepAlive      int
	PingTimeout    int
	CleanSession   bool
	OrderMatters   bool
}

type Core

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

Core allows us to send MQTT message

func NewCore

func NewCore(conf *ClientConfig) (*Core, error)

NewCore returns a Responser that can send MQTT message with MQTT client c

func (*Core) Pub

func (c *Core) Pub(topic string, qos byte, retained bool, data interface{}) error

Pub is used to send MQTT message

Jump to

Keyboard shortcuts

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