server

package
v0.0.0-...-63ac091 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Close the client and clean up all connections
	Close() error
	// GetPahoPubSub PubSub Subscribe to uplink and events, publish downlink
	GetPahoPubSub() (*PahoPubSub, error)
}

Client interface for a paho server

func NewClient

func NewClient(appID, userName, appAccessKey, mqttAddress string) Client

NewClient creates a new API client from the configuration, using the given Application ID and Application access key.

type ClientConfig

type ClientConfig struct {
	ClientName     string
	ClientVersion  string
	TLSConfig      *tls.Config
	RequestTimeout time.Duration
	// contains filtered or unexported fields
}

type GooglePubSub

type GooglePubSub struct {
	Joins        *pubsub.Topic
	Uplinks      *pubsub.Topic
	UplinkErrors *pubsub.Topic

	Downlinks        *pubsub.Subscription
	DownlinkReceipts *pubsub.Topic
	DownlinkErrors   *pubsub.Topic

	Location *pubsub.Topic
	Signal   *pubsub.Topic
}

type MqttProxyConfig

type MqttProxyConfig struct {
	AppID           string
	AppKey          string
	MqttAddress     string
	Username        string
	CanDownlink     bool
	GooglePubSub    GooglePubSub
	Transformer     lib.PahoTransformer
	PayloadAdjuster lib.PayloadAdjuster
}

MqttProxyConfig - for ttn the Username has the form: username = fmt.Sprintf("%s@ttn", p.AppID)

type PahoProxy

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

func NewPahoProxy

func NewPahoProxy(p MqttProxyConfig) (*PahoProxy, error)

func (*PahoProxy) Run

func (pp *PahoProxy) Run() error

Run TODO make it so we can configure which channels to listen to and forward

type PahoPubSub

type PahoPubSub struct {
	AppID   string
	DevID   string
	SubPubs map[string]string
	Errors  chan error
	// contains filtered or unexported fields
}
func (p *PahoPubSub) SendDownlink(topic string, payload []byte) error

func (*PahoPubSub) Subscribe

func (p *PahoPubSub) Subscribe(topic string) (<-chan paho.Message, error)

Jump to

Keyboard shortcuts

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