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

Function ToOrganizationID

pkg/unique/unique.go:99–105  ·  view source on GitHub ↗

ToOrganizationID returns the organization identifier of the specified unique ID.

(uid string)

Source from the content-addressed store, hash-verified

97
98// ToOrganizationID returns the organization identifier of the specified unique ID.
99func ToOrganizationID(uid string) (id *ttnpb.OrganizationIdentifiers, err error) {
100 id = &ttnpb.OrganizationIdentifiers{OrganizationId: uid}
101 if err := id.ValidateFields("organization_id"); err != nil {
102 return nil, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid)
103 }
104 return id, nil
105}
106
107// ToUserID returns the user identifier of the specified unique ID.
108func ToUserID(uid string) (id *ttnpb.UserIdentifiers, 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