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

Function ToUserID

pkg/unique/unique.go:108–114  ·  view source on GitHub ↗

ToUserID returns the user identifier of the specified unique ID.

(uid string)

Source from the content-addressed store, hash-verified

106
107// ToUserID returns the user identifier of the specified unique ID.
108func ToUserID(uid string) (id *ttnpb.UserIdentifiers, err error) {
109 id = &ttnpb.UserIdentifiers{UserId: uid}
110 if err := id.ValidateFields("user_id"); err != nil {
111 return nil, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid)
112 }
113 return id, nil
114}

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