shared

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: ISC Imports: 36 Imported by: 0

README

Shared

politeiawww can be run in different modes (ex. piwww, cmswww). Each politeiawww mode has its own CLI tool. This package contains the commands that are used by multiple CLI tools so that they don't have to be reimplement.

Documentation

Index

Constants

View Source
const CensorCommentHelpMsg = `` /* 665-byte string literal not displayed */

CensorCommentHelpMsg is the output of the help command when 'censorcomment' is specified.

View Source
const ChangePasswordHelpMsg = `` /* 354-byte string literal not displayed */

ChangePasswordHelpMsg is the output of the help command when 'changepassword' is specified.

View Source
const LoginHelpMsg = `` /* 829-byte string literal not displayed */

LoginHelpMsg is the output for the help command when 'login' is specified.

View Source
const LogoutHelpMsg = `logout 

Logout as a user or admin.

Arguments:
None

Result:
{}`

LogoutHelpMsg is the output of the help command when 'logout' is specified.

View Source
const ManageUserHelpMsg = `` /* 862-byte string literal not displayed */

ManageUserHelpMsg is the output of the help command when 'edituser' is specified.

View Source
const MeHelpMsg = `` /* 920-byte string literal not displayed */

MeHelpMsg is the output of the help command when 'me' is specified.

View Source
const NewCommentHelpMsg = `` /* 1305-byte string literal not displayed */

NewCommentHelpMsg is the output of the help command when 'newcomment' is specified.

View Source
const ResetPasswordHelpMsg = `` /* 270-byte string literal not displayed */

ResetPasswordHelpMsg is the output of the help command when 'resetpassword' is specified.

View Source
const UpdateUserKeyHelpMsg = `` /* 152-byte string literal not displayed */

UpdateUserKeyHelpMsg is the output of the help command when 'updateuserkey' is specified.

View Source
const UsersHelpMsg = `` /* 1185-byte string literal not displayed */

UsersHelpMsg is the output of the help command when 'users' is specified.

View Source
const VersionHelpMsg = `` /* 265-byte string literal not displayed */

VersionHelpMsg is the output of the help command when 'version' is specified.

Variables

View Source
var ChangeUsernameHelpMsg = `` /* 333-byte string literal not displayed */

ChangeUsernameHelpMsg is the output of the help command when 'changeusername' is specified.

View Source
var (

	// errUserIdentityNotFound is emitted when a user identity is
	// required but the config object does not contain one.
	ErrUserIdentityNotFound = errors.New("user identity not found; " +
		"you must either create a new user or use the updateuserkey " +
		"command to generate a new identity for the logged in user")
)

Functions

func DigestSHA3

func DigestSHA3(s string) string

DigestSHA3 returns the hex encoded SHA3-256 of a string.

func MerkleRoot

func MerkleRoot(files []v1.File, md []v1.Metadata) (string, error)

MerkleRoot converts the passed in list of files and metadata into SHA256 digests then calculates and returns the merkle root of the digests.

func NewIdentity

func NewIdentity() (*identity.FullIdentity, error)

NewIdentity generates a new FullIdentity using randomly generated data to create the public/private key pair.

func PrintJSON

func PrintJSON(body interface{}) error

PrintJSON prints the passed in JSON using the style specified by the global config variable.

func SetClient

func SetClient(c *Client)

SetClient sets the global client variable.

func SetConfig

func SetConfig(config *Config)

SetConfig sets the global config variable.

func SignedMerkleRoot

func SignedMerkleRoot(files []v1.File, md []v1.Metadata, id *identity.FullIdentity) (string, error)

SignedMerkleRoot calculates the merkle root of the passed in list of files and metadata, signs the merkle root with the passed in identity and returns the signature.

Types

type CensorCommentCmd

type CensorCommentCmd struct {
	Args struct {
		Token     string `positional-arg-name:"token"`     // Censorship token
		CommentID string `positional-arg-name:"commentID"` // Comment ID
		Reason    string `positional-arg-name:"reason"`    // Reason for censoring
	} `positional-args:"true" required:"true"`
}

CensorCommentCmd censors a proposal comment.

func (*CensorCommentCmd) Execute

func (cmd *CensorCommentCmd) Execute(args []string) error

Execute executes the censor comment command.

type ChangePasswordCmd

type ChangePasswordCmd struct {
	Args struct {
		Password    string `positional-arg-name:"currentPassword"` // Current password
		NewPassword string `positional-arg-name:"newPassword"`     // New password
	} `positional-args:"true" required:"true"`
}

ChangePasswordCmd changes the password for the logged in user.

func (*ChangePasswordCmd) Execute

func (cmd *ChangePasswordCmd) Execute(args []string) error

Execute executes the change password command.

type ChangeUsernameCmd

type ChangeUsernameCmd struct {
	Args struct {
		Password    string `positional-arg-name:"password"`    // User password
		NewUsername string `positional-arg-name:"newusername"` // New username
	} `positional-args:"true" required:"true"`
}

ChangeUsernameCmd changes the username for the logged in user.

func (*ChangeUsernameCmd) Execute

func (cmd *ChangeUsernameCmd) Execute(args []string) error

Execute executes the change username command.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a politeiawww client.

func NewClient

func NewClient(cfg *Config) (*Client, error)

New returns a new politeiawww client.

func (*Client) ActiveVotes

func (c *Client) ActiveVotes() (*www.ActiveVoteReply, error)

ActiveVotes retreives all proposals that are currently being voted on.

func (*Client) AdminInvoices

func (c *Client) AdminInvoices(ai *cms.AdminInvoices) (*cms.AdminInvoicesReply, error)

AdminInvoices retrieves invoices base on possible field set in the request month/year and/or status

func (*Client) AuthorizeVote

func (c *Client) AuthorizeVote(av *www.AuthorizeVote) (*www.AuthorizeVoteReply, error)

AuthorizeVote authorizes the voting period for the specified proposal using the logged in user.

func (*Client) BatchProposals

func (c *Client) BatchProposals(bp *www.BatchProposals) (*www.BatchProposalsReply, error)

BatchProposals retrieves a list of proposals

func (*Client) BatchVoteSummary

func (c *Client) BatchVoteSummary(bvs *www.BatchVoteSummary) (*www.BatchVoteSummaryReply, error)

BatchVoteSummary retrieves a summary of the voting process for a set of proposals.

func (*Client) CMSEditUser

func (c *Client) CMSEditUser(uui cms.EditUser) (*cms.EditUserReply, error)

CMSEditUser edits the current user's information.

func (*Client) CMSManageUser

func (c *Client) CMSManageUser(uui cms.CMSManageUser) (*cms.CMSManageUserReply, error)

CMSManageUser updates the given user's information.

func (*Client) CMSPolicy

func (c *Client) CMSPolicy() (*cms.PolicyReply, error)

CMSPolicy returns the politeiawww policy information.

func (*Client) CMSUserDetails

func (c *Client) CMSUserDetails(userID string) (*cms.UserDetailsReply, error)

CMSUserDetails returns the current cms user's information.

func (*Client) CMSUsers

func (c *Client) CMSUsers(cu *cms.CMSUsers) (*cms.CMSUsersReply, error)

CMSUsers retrieves a list of cms users that adhere to the specified filtering parameters.

func (*Client) CastVotes

func (c *Client) CastVotes(b *www.Ballot) (*www.BallotReply, error)

CastVotes casts votes for a proposal.

func (*Client) CensorComment

func (c *Client) CensorComment(cc *www.CensorComment) (*www.CensorCommentReply, error)

CensorComment censors the specified proposal comment.

func (*Client) ChangePassword

func (c *Client) ChangePassword(cp *www.ChangePassword) (*www.ChangePasswordReply, error)

ChangePassword changes the password for the logged in user.

func (*Client) ChangeUsername

func (c *Client) ChangeUsername(cu *www.ChangeUsername) (*www.ChangeUsernameReply, error)

ChangeUsername changes the username of the logged in user.

func (*Client) Close

func (c *Client) Close()

Close all client connections.

func (*Client) CommittedTickets

CommittedTickets returns the committed tickets that belong to the dcrwallet instance out of the the specified list of tickets.

func (*Client) DCCComments

func (c *Client) DCCComments(token string) (*www.GetCommentsReply, error)

DCCComments retrieves the comments for the specified proposal.

func (*Client) DCCDetails

func (c *Client) DCCDetails(token string) (*cms.DCCDetailsReply, error)

DCCDetails retrieves the specified dcc.

func (*Client) EditInvoice

func (c *Client) EditInvoice(ei *cms.EditInvoice) (*cms.EditInvoiceReply, error)

EditInvoice edits the specified invoice with the logged in user.

func (*Client) EditProposal

func (c *Client) EditProposal(ep *www.EditProposal) (*www.EditProposalReply, error)

EditProposal edits the specified proposal with the logged in user.

func (*Client) EditUser

func (c *Client) EditUser(eu *www.EditUser) (*www.EditUserReply, error)

EditUser allows the logged in user to update their user settings.

func (*Client) GeneratePayouts

func (c *Client) GeneratePayouts(gp *cms.GeneratePayouts) (*cms.GeneratePayoutsReply, error)

GeneratePayouts generates a list of payouts for all approved invoices that contain an address and amount for an admin to the process

func (*Client) GetAllVetted

func (c *Client) GetAllVetted(gav *www.GetAllVetted) (*www.GetAllVettedReply, error)

GetAllVetted retrieves a page of vetted proposals.

func (*Client) GetAllVoteStatus

func (c *Client) GetAllVoteStatus() (*www.GetAllVoteStatusReply, error)

GetAllVoteStatus retreives the vote status of all public proposals.

func (*Client) GetComments

func (c *Client) GetComments(token string) (*www.GetCommentsReply, error)

GetComments retrieves the comments for the specified proposal.

func (*Client) GetDCCs

func (c *Client) GetDCCs(gd *cms.GetDCCs) (*cms.GetDCCsReply, error)

GetDCCss retrieves invoices base on possible field set in the request month/year and/or status

func (*Client) InviteNewUser

func (c *Client) InviteNewUser(inu *cms.InviteNewUser) (*cms.InviteNewUserReply, error)

InviteNewUser creates a new cmswww user.

func (*Client) InvoiceComments

func (c *Client) InvoiceComments(token string) (*www.GetCommentsReply, error)

GetComments retrieves the comments for the specified proposal.

func (*Client) InvoiceDetails

func (c *Client) InvoiceDetails(token string) (*cms.InvoiceDetailsReply, error)

InvoiceDetails retrieves the specified invoice.

func (*Client) InvoiceExchangeRate

func (c *Client) InvoiceExchangeRate(ier *cms.InvoiceExchangeRate) (*cms.InvoiceExchangeRateReply, error)

InvoiceExchangeRate changes the status of the specified invoice.

func (*Client) InvoicePayouts

func (c *Client) InvoicePayouts(lip *cms.InvoicePayouts) (*cms.InvoicePayoutsReply, error)

InvoicePayouts retrieves invoices base on possible field set in the request month/year and/or status

func (*Client) LikeComment

func (c *Client) LikeComment(lc *www.LikeComment) (*www.LikeCommentReply, error)

LikeComment casts a like comment action (upvote/downvote) for the logged in user.

func (*Client) LoadWalletClient

func (c *Client) LoadWalletClient() error

LoadWalletClient connects to a dcrwallet instance.

func (*Client) Login

func (c *Client) Login(l *www.Login) (*www.LoginReply, error)

Login logs a user into politeiawww.

func (*Client) Logout

func (c *Client) Logout() (*www.LogoutReply, error)

Logout logs out a user from politeiawww.

func (*Client) ManageUser

func (c *Client) ManageUser(mu *www.ManageUser) (*www.ManageUserReply, error)

ManageUser allows an admin to edit certain attributes of the specified user.

func (*Client) Me

func (c *Client) Me() (*www.LoginReply, error)

Me returns user details for the logged in user.

func (*Client) NewComment

func (c *Client) NewComment(nc *www.NewComment) (*www.NewCommentReply, error)

NewComment submits a new proposal comment for the logged in user.

func (*Client) NewDCC

func (c *Client) NewDCC(nd cms.NewDCC) (*cms.NewDCCReply, error)

NewDCC creates a new dcc proposal.

func (*Client) NewDCCComment

func (c *Client) NewDCCComment(nc *www.NewComment) (*www.NewCommentReply, error)

NewDCCComment submits a new dcc comment for the logged in user.

func (*Client) NewInvoice

func (c *Client) NewInvoice(ni *cms.NewInvoice) (*cms.NewInvoiceReply, error)

NewInvoice submits the specified invoice to politeiawww for the logged in user.

func (*Client) NewProposal

func (c *Client) NewProposal(np *www.NewProposal) (*www.NewProposalReply, error)

NewProposal submits the specified proposal to politeiawww for the logged in user.

func (*Client) NewUser

func (c *Client) NewUser(nu *www.NewUser) (*www.NewUserReply, error)

NewUser creates a new politeiawww user.

func (*Client) PayInvoices

func (c *Client) PayInvoices(pi *cms.PayInvoices) (*cms.PayInvoicesReply, error)

PayInvoices is a temporary command that allows an administrator to set all approved invoices to the paid status. This will be removed once the address watching for payment is complete and working.

func (*Client) Policy

func (c *Client) Policy() (*www.PolicyReply, error)

Policy returns the politeiawww policy information.

func (*Client) ProposalBilling

func (c *Client) ProposalBilling(pb *cms.ProposalBilling) (*cms.ProposalBillingReply, error)

ProposalBilling retrieves the billing for the requested proposal

func (*Client) ProposalDetails

func (c *Client) ProposalDetails(token string, pd *www.ProposalsDetails) (*www.ProposalDetailsReply, error)

ProposalDetails retrieves the specified proposal.

func (*Client) ProposalOwner

func (c *Client) ProposalOwner(po *cms.ProposalOwner) (*cms.ProposalOwnerReply, error)

ProposalOwner retrieves the subcontractors that are linked to the requesting user

func (*Client) ProposalPaywallDetails

func (c *Client) ProposalPaywallDetails() (*www.ProposalPaywallDetailsReply, error)

ProposalPaywallDetails retrieves proposal credit paywall information for the logged in user.

func (*Client) ProposalPaywallPayment

func (c *Client) ProposalPaywallPayment() (*www.ProposalPaywallPaymentReply, error)

ProposalPaywallPayment retrieves payment details of any pending proposal credit payment from the logged in user.

func (*Client) RegisterUser

func (c *Client) RegisterUser(ru *cms.RegisterUser) (*cms.RegisterUserReply, error)

RegisterUser finalizes the signup process for a new cmswww user.

func (*Client) ResendVerification

func (c *Client) ResendVerification(rv www.ResendVerification) (*www.ResendVerificationReply, error)

ResendVerification re-sends the user verification email for an unverified user.

func (*Client) ResetPassword

func (c *Client) ResetPassword(rp *www.ResetPassword) (*www.ResetPasswordReply, error)

ResetPassword resets the password of the specified user.

func (*Client) Secret

func (c *Client) Secret() (*www.UserError, error)

Secret pings politeiawww.

func (*Client) SetDCCStatus

func (c *Client) SetDCCStatus(sd *cms.SetDCCStatus) (*cms.SetDCCStatusReply, error)

SetDCCStatus issues an status update for a given DCC proposal.

func (*Client) SetInvoiceStatus

func (c *Client) SetInvoiceStatus(sis *cms.SetInvoiceStatus) (*cms.SetInvoiceStatusReply, error)

SetInvoiceStatus changes the status of the specified invoice.

func (*Client) SetProposalStatus

func (c *Client) SetProposalStatus(sps *www.SetProposalStatus) (*www.SetProposalStatusReply, error)

SetProposalStatus changes the status of the specified proposal.

func (*Client) SignMessages

SignMessages signs the passed in messages using the private keys from the specified addresses.

func (*Client) StartVoteRunoffV2

func (c *Client) StartVoteRunoffV2(svr www2.StartVoteRunoff) (*www2.StartVoteRunoffReply, error)

StartVoteRunoffV2 sends the given StartVoteRunoff to the politeiawww v2 StartVoteRunoffRoute and returns the reply.

func (*Client) StartVoteV2

func (c *Client) StartVoteV2(sv www2.StartVote) (*www2.StartVoteReply, error)

StartVoteV2 sends the provided v2 StartVote to the politeiawww backend.

func (*Client) SupportOpposeDCC

func (c *Client) SupportOpposeDCC(sd cms.SupportOpposeDCC) (*cms.SupportOpposeDCCReply, error)

SupportOpposeDCC issues support for a given DCC proposal.

func (*Client) TokenInventory

func (c *Client) TokenInventory() (*www.TokenInventoryReply, error)

TokenInventory retrieves the censorship record tokens of all proposals in the inventory.

func (*Client) UpdateUserKey

func (c *Client) UpdateUserKey(uuk *www.UpdateUserKey) (*www.UpdateUserKeyReply, error)

UpdateUserKey updates the identity of the logged in user.

func (*Client) UserCommentsLikes

func (c *Client) UserCommentsLikes(token string) (*www.UserCommentsLikesReply, error)

UserCommentsLikes retrieves the comment likes (upvotes/downvotes) for the specified proposal that are from the logged in user.

func (*Client) UserDetails

func (c *Client) UserDetails(userID string) (*www.UserDetailsReply, error)

UserDetails retrieves the user details for the specified user.

func (*Client) UserInvoices

func (c *Client) UserInvoices(up *cms.UserInvoices) (*cms.UserInvoicesReply, error)

UserInvoices retrieves the proposals that have been submitted by the specified user.

func (*Client) UserPaymentsRescan

func (c *Client) UserPaymentsRescan(upr *www.UserPaymentsRescan) (*www.UserPaymentsRescanReply, error)

UserPaymentsRescan scans the specified user's paywall address and makes sure that the user's account has been properly credited with all payments.

func (*Client) UserProposalCredits

func (c *Client) UserProposalCredits() (*www.UserProposalCreditsReply, error)

UserProposalCredits retrieves the proposal credit history for the logged in user.

func (*Client) UserProposals

func (c *Client) UserProposals(up *www.UserProposals) (*www.UserProposalsReply, error)

UserProposals retrieves the proposals that have been submitted by the specified user.

func (*Client) UserSubContractors

func (c *Client) UserSubContractors(usc *cms.UserSubContractors) (*cms.UserSubContractorsReply, error)

UserSubContractors retrieves the subcontractors that are linked to the requesting user

func (*Client) Users

func (c *Client) Users(u *www.Users) (*www.UsersReply, error)

Users retrieves a list of users that adhere to the specified filtering parameters.

func (*Client) VerifyNewUser

func (c *Client) VerifyNewUser(vnu *www.VerifyNewUser) (*www.VerifyNewUserReply, error)

VerifyNewUser verifies a user's email address.

func (*Client) VerifyResetPassword

func (c *Client) VerifyResetPassword(vrp www.VerifyResetPassword) (*www.VerifyResetPasswordReply, error)

VerifyResetPassword sends the VerifyResetPassword command to politeiawww.

func (*Client) VerifyUpdateUserKey

func (c *Client) VerifyUpdateUserKey(vuuk *www.VerifyUpdateUserKey) (*www.VerifyUpdateUserKeyReply, error)

VerifyUpdateUserKey is used to verify a new user identity.

func (*Client) VerifyUserPayment

func (c *Client) VerifyUserPayment() (*www.VerifyUserPaymentReply, error)

VerifyUserPayment checks whether the logged in user has paid their user registration fee.

func (*Client) Version

func (c *Client) Version() (*www.VersionReply, error)

Version returns the version information for the politeiawww instance.

func (*Client) VoteDetailsV2

func (c *Client) VoteDetailsV2(token string) (*www2.VoteDetailsReply, error)

VoteDetailsV2 returns the proposal vote details for the given token using the www v2 VoteDetails route.

func (*Client) VoteResults

func (c *Client) VoteResults(token string) (*www.VoteResultsReply, error)

VoteResults retrieves the vote results for the specified proposal.

func (*Client) VoteStatus

func (c *Client) VoteStatus(token string) (*www.VoteStatusReply, error)

VoteStatus retrieves the vote status for the specified proposal.

func (*Client) WalletAccounts

func (c *Client) WalletAccounts() (*walletrpc.AccountsResponse, error)

WalletAccounts retrieves the walletprc accounts.

type Config

type Config struct {
	HomeDir     string `long:"appdata" description:"Path to application home directory"`
	Host        string `long:"host" description:"politeiawww host"`
	RawJSON     bool   `short:"j" long:"json" description:"Print raw JSON output"`
	ShowVersion bool   `short:"V" long:"version" description:"Display version information and exit"`
	SkipVerify  bool   `long:"skipverify" description:"Skip verifying the server's certifcate chain and host name"`
	Verbose     bool   `short:"v" long:"verbose" description:"Print verbose output"`
	Silent      bool   `long:"silent" description:"Suppress all output"`

	DataDir    string // Application data dir
	Version    string // CLI version
	WalletHost string // Wallet host
	WalletCert string // Wallet GRPC certificate
	FaucetHost string // Testnet faucet host
	CSRF       string // CSRF header token

	Identity *identity.FullIdentity // User identity
	Cookies  []*http.Cookie         // User cookies
}

Config represents the piwww configuration settings.

func LoadConfig

func LoadConfig(homeDir, dataDirname, configFilename string) (*Config, error)

LoadConfig initializes and parses the config using a config file and command line options.

The configuration proceeds as follows:

  1. Start with a default config with sane settings
  2. Pre-parse the command line to check for an alternative config file
  3. Load configuration file overwriting defaults with any specified options
  4. Parse CLI options and overwrite/add any specified options

The above results in politeiawwwcli functioning properly without any config settings while still allowing the user to override settings with config files and command line options. Command line options always take precedence.

func (*Config) LoadIdentity

func (cfg *Config) LoadIdentity(username string) (*identity.FullIdentity, error)

func (*Config) SaveCSRF

func (cfg *Config) SaveCSRF(csrf string) error

SaveCSRF writes the passed in CSRF token to the host specific CSRF file.

func (*Config) SaveCookies

func (cfg *Config) SaveCookies(cookies []*http.Cookie) error

SaveCookies writes the passed in cookies to the host specific cookie file.

func (*Config) SaveIdentity

func (cfg *Config) SaveIdentity(user string, id *identity.FullIdentity) error

SaveIdentity writes the passed in user identity to disk so that it can be persisted between commands. The prepend the hostname and the username onto the idenity filename so that we can keep track of the identities for multiple users per host.

func (*Config) SaveLoggedInUsername

func (cfg *Config) SaveLoggedInUsername(username string) error

SaveLoggedInUsername saved the passed in username to the on-disk user file. We persist the logged in username between commands so that we know which identity to load.

type LoginCmd

type LoginCmd struct {
	Args struct {
		Email    string `positional-arg-name:"email"`
		Password string `positional-arg-name:"password"`
	} `positional-args:"true" required:"true"`
}

LoginCmd logs into Politeia using the specified credentials.

func (*LoginCmd) Execute

func (cmd *LoginCmd) Execute(args []string) error

Execute executes the login command.

type LogoutCmd

type LogoutCmd struct{}

LogoutCmd logs the user out of Politeia.

func (*LogoutCmd) Execute

func (cmd *LogoutCmd) Execute(args []string) error

Execute executes the logout command.

type ManageUserCmd

type ManageUserCmd struct {
	Args struct {
		UserID string `positional-arg-name:"userid"` // User ID
		Action string `positional-arg-name:"action"` // Edit user action
		Reason string `positional-arg-name:"reason"` // Reason for editing user
	} `positional-args:"true" required:"true"`
}

ManageUserCmd allows an admin to edit certain properties of the specified user.

func (*ManageUserCmd) Execute

func (cmd *ManageUserCmd) Execute(args []string) error

Execute executes the manage user command.

type MeCmd

type MeCmd struct{}

MeCmd gets the user details of the logged in user.

func (*MeCmd) Execute

func (cmd *MeCmd) Execute(args []string) error

Execute executes the me command.

type NewCommentCmd

type NewCommentCmd struct {
	Args struct {
		Token    string `positional-arg-name:"token" required:"true"`   // Censorship token
		Comment  string `positional-arg-name:"comment" required:"true"` // Comment text
		ParentID string `positional-arg-name:"parentID"`                // Comment parent ID
	} `positional-args:"true"`
}

NewCommentCmd submits a new proposal comment.

func (*NewCommentCmd) Execute

func (cmd *NewCommentCmd) Execute(args []string) error

Execute executes the new comment command.

type ResetPasswordCmd

type ResetPasswordCmd struct {
	Args struct {
		Username    string `positional-arg-name:"username"`    // Username
		Email       string `positional-arg-name:"email"`       // User email address
		NewPassword string `positional-arg-name:"newpassword"` // New password
	} `positional-args:"true" required:"true"`
}

ResetPasswordCmd resets the password of the specified user.

func (*ResetPasswordCmd) Execute

func (cmd *ResetPasswordCmd) Execute(args []string) error

Execute executes the reset password command.

type SecretCmd

type SecretCmd struct{}

SecretCmd pings the politeiawww secret route.

func (*SecretCmd) Execute

func (cmd *SecretCmd) Execute(args []string) error

Execute executes the secret command.

type UpdateUserKeyCmd

type UpdateUserKeyCmd struct {
	NoSave bool `long:"nosave"` // Don't save new identity to disk
}

UpdateUserKeyCmd creates a new identity for the logged in user.

func (*UpdateUserKeyCmd) Execute

func (cmd *UpdateUserKeyCmd) Execute(args []string) error

Execute executes the update user key command.

type UsersCmd

type UsersCmd struct {
	Email     string `long:"email"`    // Email filter
	Username  string `long:"username"` // Username filter
	PublicKey string `long:"pubkey"`   // Username filter
}

UsersCmd retreives a list of users that have been filtered using the specified filtering params.

func (*UsersCmd) Execute

func (cmd *UsersCmd) Execute(args []string) error

Execute executes the users command.

type VersionCmd

type VersionCmd struct{}

VersionCmd retrieves the server version information and CSRF token.

func (*VersionCmd) Execute

func (cmd *VersionCmd) Execute(args []string) error

Execute executes the version command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL