Documentation ¶
Overview ¶
Package unique provides functionality for working with unique identifiers of entities within a context.
Index ¶
- func GenericID(ctx context.Context, uidPattern string) (res string)
- func ID(ctx context.Context, id ttnpb.IDStringer) (res string)
- func ToApplicationID(uid string) (id *ttnpb.ApplicationIdentifiers, err error)
- func ToClientID(uid string) (id *ttnpb.ClientIdentifiers, err error)
- func ToDeviceID(uid string) (id *ttnpb.EndDeviceIdentifiers, err error)
- func ToGatewayID(uid string) (id *ttnpb.GatewayIdentifiers, err error)
- func ToOrganizationID(uid string) (id *ttnpb.OrganizationIdentifiers, err error)
- func ToUserID(uid string) (id *ttnpb.UserIdentifiers, err error)
- func WithContext(ctx context.Context, uid string) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Types ¶
This section is empty.