deviceid

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromUUID

func FromUUID(deviceUUIDString string) (string, error)

FromUUID converts a UUID string to a Device ID in the standard Astarte representation (Base 64 Url Encoded)

func Generate

func Generate(uuidNamespace string, payloadData []byte) (string, error)

Generate returns an Astarte Device ID generated from a namespaced arbitrary payload. It is guaranteed to be always the same for the same namespace and payload. This is the go-to function to generate Astarte device IDs.

func GenerateRandom

func GenerateRandom() (string, error)

GenerateRandom returns a new Astarte Device ID on a fully Random basis. Do not use in production environments.

func IsValid

func IsValid(deviceID string) bool

IsValid returns whether the provided Device ID is a valid Astarte Device ID or not.

func ToUUID

func ToUUID(deviceID string) (string, error)

ToUUID converts a Device ID from the standard Astarte representation (Base 64 Url Encoded) to UUID string representation. This is useful to interact directly with Cassandra, that uses that representation to store Device IDs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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