MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ToClientID

Function ToClientID

pkg/unique/unique.go:64–70  ·  view source on GitHub ↗

ToClientID returns the client identifier of the specified unique ID.

(uid string)

Source from the content-addressed store, hash-verified

62
63// ToClientID returns the client identifier of the specified unique ID.
64func ToClientID(uid string) (id *ttnpb.ClientIdentifiers, err error) {
65 id = &ttnpb.ClientIdentifiers{ClientId: uid}
66 if err := id.ValidateFields("client_id"); err != nil {
67 return nil, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid)
68 }
69 return id, nil
70}
71
72// ToDeviceID returns the end device identifier of the specified unique ID.
73func ToDeviceID(uid string) (id *ttnpb.EndDeviceIdentifiers, err error) {

Callers 3

decodeEventMetaFunction · 0.92
TestRoundtripFunction · 0.85

Calls 3

ValidateFieldsMethod · 0.45
WithAttributesMethod · 0.45
WithCauseMethod · 0.45

Tested by 2

TestRoundtripFunction · 0.68