utils

package
v0.0.0-...-84d3d55 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttConnection

type MqttConnection struct {
	ConnectionUrl string
	// MqttPath      string
	ToStop        bool
	State         models.ServerStatus
	ClientOptions *mqtt.ClientOptions
	// contains filtered or unexported fields
}

func NewMqttConnection

func NewMqttConnection(brokerUrl string, opts ...*mqtt.ClientOptions) (*MqttConnection, error)

func (*MqttConnection) Close

func (mq *MqttConnection) Close()

func (*MqttConnection) Connect

func (mq *MqttConnection) Connect() error

func (*MqttConnection) Publish

func (mq *MqttConnection) Publish(topic string, qos byte, retained bool, payload []byte) error

func (*MqttConnection) Stop

func (mq *MqttConnection) Stop()

func (*MqttConnection) Subscribe

func (mq *MqttConnection) Subscribe(subPath string, pubFn func(client mqtt.Client, msg mqtt.Message)) error

type Quicer

type Quicer struct {
	Cfg          quic.Config
	RoundTripper *http3.RoundTripper
	Client       *http.Client
}

func QuicConnect

func QuicConnect(cfg *quic.Config) (*Quicer, error)

func (*Quicer) Close

func (q *Quicer) Close()

func (*Quicer) GetBody

func (q *Quicer) GetBody(urlstr string, header *http.Header) ([]byte, *http.Response, error)

func (*Quicer) ProxyRequest

func (q *Quicer) ProxyRequest(
	proxyUrlStr string,
	method string,
	backendUrlStr string,
	header *http.Header,
	body io.ReadCloser) (*http.Response, error)

Jump to

Keyboard shortcuts

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