util

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0, EPL-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(filename string) bool

FileExists returns if the file with provided name exists.

func NewHonoUserName

func NewHonoUserName(deviceAuthID, hubTenantID string) string

NewHonoUserName returns the Hono connection user name.

func NormalizeTopic

func NormalizeTopic(topic string) string

NormalizeTopic convert command topics to long form

func ParseCmdTopic

func ParseCmdTopic(topic string) (string, string, string)

ParseCmdTopic parses a MQTT message topic.

func ParseTimeout

func ParseTimeout(timeout string) time.Duration

ParseTimeout converts timeout from string to time.Duration.

func ReplacePattern

func ReplacePattern(pattern string, cert tls.Certificate) (string, error)

ReplacePattern resolves a pettern using the provided certificate data.

func ResponseStatusTopic

func ResponseStatusTopic(inboxTopic string, status int) string

ResponseStatusTopic builds the response status topic, e.g. for a received inbox topic "command///req/${req-id}/response" the reply should be "command///res/${req-id}/${status}".

func SetupProvisioningWatcher

func SetupProvisioningWatcher(path string) (*fsnotify.Watcher, error)

SetupProvisioningWatcher creates a file watcher for the provided path.

func ValidPath

func ValidPath(filename string) error

ValidPath returns error if the provided filename is not a valid one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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