v5client

package
v2.1.0-beta.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func Provision

func Provision(ctx api.StreamContext, props map[string]any, onConnect client.ConnectHandler, onConnectLost client.ConnectErrorHandler, _ client.ConnectHandler) (*Client, error)

func (*Client) Connect

func (c *Client) Connect(ctx api.StreamContext) error

func (*Client) Disconnect

func (c *Client) Disconnect(ctx api.StreamContext)

func (*Client) ParseMsg

func (c *Client) ParseMsg(ctx api.StreamContext, msg any) ([]byte, map[string]any, map[string]string)

func (*Client) Publish

func (c *Client) Publish(ctx api.StreamContext, topic string, qos byte, retained bool, payload []byte, properties map[string]string) error

func (*Client) Subscribe

func (c *Client) Subscribe(ctx api.StreamContext, topic string, qos byte, callback client.MessageHandler) error

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(ctx api.StreamContext, topic string) error

type ConnectionConfig

type ConnectionConfig struct {
	Server   string `json:"server"`
	ClientId string `json:"clientid"`
	Uname    string `json:"username"`
	Password string `json:"password"`
	// contains filtered or unexported fields
}

func ValidateConfig

func ValidateConfig(props map[string]any) (*ConnectionConfig, error)

Jump to

Keyboard shortcuts

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