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

Function getUserID

cmd/ttn-lw-cli/commands/users.go:47–61  ·  view source on GitHub ↗
(flagSet *pflag.FlagSet, args []string)

Source from the content-addressed store, hash-verified

45var errNoUserID = errors.DefineInvalidArgument("no_user_id", "no user ID set")
46
47func getUserID(flagSet *pflag.FlagSet, args []string) *ttnpb.UserIdentifiers {
48 var userID string
49 if len(args) > 0 {
50 if len(args) > 1 {
51 logger.Warn("Multiple IDs found in arguments, considering only the first")
52 }
53 userID = args[0]
54 } else {
55 userID, _ = flagSet.GetString("user-id")
56 }
57 if userID == "" {
58 return nil
59 }
60 return &ttnpb.UserIdentifiers{UserId: userID}
61}
62
63func printPasswordRequirements(msg *ttnpb.IsConfiguration_UserRegistration_PasswordRequirements) {
64 if msg == nil {

Callers 8

users.goFile · 0.85
users_access.goFile · 0.85
users_oauth.goFile · 0.85
users_sessions.goFile · 0.85
users_bookmarks.goFile · 0.85
organizations.goFile · 0.85

Calls 1

WarnMethod · 0.65

Tested by

no test coverage detected