unique

package
v3.33.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package unique provides functionality for working with unique identifiers of entities within a context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericID added in v3.15.2

func GenericID(ctx context.Context, uidPattern string) (res string)

GenericID returns a generic selector identifier for an entity.

func ID

func ID(ctx context.Context, id ttnpb.IDStringer) (res string)

ID returns the unique identifier of the specified identifiers. This function panics if the resulting identifier is invalid. The reason for panicking is that taking the unique identifier of a nil or zero value may result in unexpected and potentially harmful behavior.

func ToApplicationID

func ToApplicationID(uid string) (id *ttnpb.ApplicationIdentifiers, err error)

ToApplicationID returns the application identifier of the specified unique ID.

func ToClientID

func ToClientID(uid string) (id *ttnpb.ClientIdentifiers, err error)

ToClientID returns the client identifier of the specified unique ID.

func ToDeviceID

func ToDeviceID(uid string) (id *ttnpb.EndDeviceIdentifiers, err error)

ToDeviceID returns the end device identifier of the specified unique ID.

func ToGatewayID

func ToGatewayID(uid string) (id *ttnpb.GatewayIdentifiers, err error)

ToGatewayID returns the gateway identifier of the specified unique ID.

func ToOrganizationID

func ToOrganizationID(uid string) (id *ttnpb.OrganizationIdentifiers, err error)

ToOrganizationID returns the organization identifier of the specified unique ID.

func ToUserID

func ToUserID(uid string) (id *ttnpb.UserIdentifiers, err error)

ToUserID returns the user identifier of the specified unique ID.

func WithContext

func WithContext(ctx context.Context, uid string) (context.Context, error)

WithContext returns the given context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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