mqtt

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

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringWithCharset

func StringWithCharset(length int) string

Types

type PublishConfig

type PublishConfig struct {
	URL               string
	TopicPrefix       string
	TopicCount        uint
	PublisherPrefix   string
	PublisherCount    uint
	ProtocolVersion   uint
	QoSType           uint8
	CleanSession      bool
	ConnectDelay      time.Duration
	ChurnRate         time.Duration
	MessageRate       time.Duration
	PrometheusPath    string
	PrometheusEnabled bool
	ListenAddr        string
	User              string
	Password          string
}

type PublisherPool

type PublisherPool struct {
	TopicPrefix string
	// contains filtered or unexported fields
}

func NewDefaultPublisherPool

func NewDefaultPublisherPool(conf PublishConfig) PublisherPool

func (*PublisherPool) Connect

func (pubs *PublisherPool) Connect(topicCount uint, connectDelay time.Duration) error

func (*PublisherPool) Publish

func (pubs *PublisherPool) Publish(qos byte, topicCount uint, connectDelay, messageRate time.Duration) error

type SubscribeConfig

type SubscribeConfig struct {
	URL               string
	TopicPrefix       string
	TopicCount        uint
	ProtocolVersion   uint
	SubscriberPrefix  string
	ConnectDelay      time.Duration
	ChurnRate         time.Duration
	CleanSession      bool
	PrometheusEnabled bool
	PrometheusPath    string
	ListenAddr        string
	User              string
	Password          string
}

type SubscriberPool

type SubscriberPool struct {
	TopicPrefix string
	// contains filtered or unexported fields
}

func NewDefaultSubscriberPool

func NewDefaultSubscriberPool(conf SubscribeConfig) (SubscriberPool, error)

func (*SubscriberPool) Churn

func (subs *SubscriberPool) Churn(churnRate, connectDelay time.Duration) error

func (*SubscriberPool) Subscribe

func (subs *SubscriberPool) Subscribe(topicPrefix string, topicCount uint, connectDelay time.Duration) error

Jump to

Keyboard shortcuts

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