github.com/decred/politeia@v1.4.0/politeiawww/cmd/shared/me.go (about)

     1  // Copyright (c) 2017-2019 The Decred developers
     2  // Use of this source code is governed by an ISC
     3  // license that can be found in the LICENSE file.
     4  
     5  package shared
     6  
     7  // MeCmd gets the user details of the logged in user.
     8  type MeCmd struct{}
     9  
    10  // Execute executes the me command.
    11  func (cmd *MeCmd) Execute(args []string) error {
    12  	lr, err := client.Me()
    13  	if err != nil {
    14  		return err
    15  	}
    16  	return PrintJSON(lr)
    17  }
    18  
    19  // MeHelpMsg is the output of the help command when 'me' is specified.
    20  const MeHelpMsg = `me
    21  
    22  Fetch details for the currently logged in user. 
    23  
    24  Arguments:
    25  None
    26  
    27  Response:
    28  {
    29    "isadmin":                 (bool)        Is user an admin
    30    "userid":                  (uuid.UUID)   Unique user uuid
    31    "email":                   (string)      Email address + lookup key
    32    "username":                (string)      Unique username
    33    "publickey":               (string)      User's public key
    34    "paywalladdress":          (string)      Registration paywall address
    35    "paywallamount":           (uint64)      Registration paywall amount in atoms
    36    "paywalltxnotbefore":      (int64)       Minimum timestamp for paywall tx
    37    "paywalltxid":             (string)      Paywall payment tx ID
    38    "proposalcredits":         (uint64)      Proposal credits available to spend
    39    "lastlogintime":           (int64)       Unix timestamp of last login date
    40    "sessionmaxage":           (int64)       Unix timestamp of session max age
    41  }`