types

package
v1.5.6-perf-and-mqtt Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MqttBrokerFromContext

func MqttBrokerFromContext(ctx context.Context) (*confmqtt.Broker, bool)

func MustMqttBrokerFromContext

func MustMqttBrokerFromContext(ctx context.Context) *confmqtt.Broker

func WithChannels

func WithChannels(ctx context.Context, v []*Channel) context.Context

func WithChannelsContext

func WithChannelsContext(v []*Channel) contextx.WithContext

func WithMqttBroker

func WithMqttBroker(ctx context.Context, v *confmqtt.Broker) context.Context

func WithMqttBrokerContext

func WithMqttBrokerContext(v *confmqtt.Broker) contextx.WithContext

Types

type Channel

type Channel struct {
	Publisher   `env:""`
	Topic       string        `env:""`
	EventType   string        `env:""`
	PubInterval time.Duration `env:""`
}

func ChannelsFromContext

func ChannelsFromContext(ctx context.Context) ([]*Channel, bool)

func MustChannelsFromContext

func MustChannelsFromContext(ctx context.Context) []*Channel

func (*Channel) IsZero

func (c *Channel) IsZero() bool

func (*Channel) SetDefault

func (c *Channel) SetDefault()

func (*Channel) StartPublish

func (c *Channel) StartPublish(ctx context.Context)

func (*Channel) Subscribe

func (c *Channel) Subscribe(ctx context.Context) error

type CtxChannels

type CtxChannels struct{}

type CtxMqttBroker

type CtxMqttBroker struct{}

type Publisher

type Publisher struct {
	DeviceMN string `env:""`
	Token    string `env:""`
}

func (*Publisher) IsZero

func (c *Publisher) IsZero() bool

Jump to

Keyboard shortcuts

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