v4client

package
v2.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 11 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 {
	// contains filtered or unexported fields
}

func Provision

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

func (*Client) Connect

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

func (*Client) Disconnect

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

func (*Client) ParseMsg

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

func (*Client) Publish

func (c *Client) Publish(_ api.StreamContext, topic string, qos byte, retained bool, payload []byte, _ 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(_ api.StreamContext, topic string) error

type ConnectionConfig

type ConnectionConfig struct {
	Server   string `json:"server"`
	PVersion string `json:"protocolVersion"`
	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