Documentation ¶
Index ¶
- Constants
- Variables
- func DigestSHA3(s string) string
- func MerkleRoot(files []v1.File, md []v1.Metadata) (string, error)
- func NewIdentity() (*identity.FullIdentity, error)
- func PrintJSON(body interface{}) error
- func SetClient(c *Client)
- func SetConfig(config *Config)
- func SignedMerkleRoot(files []v1.File, md []v1.Metadata, id *identity.FullIdentity) (string, error)
- type CensorCommentCmd
- type ChangePasswordCmd
- type ChangeUsernameCmd
- type Client
- func (c *Client) ActiveVotes() (*www.ActiveVoteReply, error)
- func (c *Client) AdminInvoices(ai *cms.AdminInvoices) (*cms.AdminInvoicesReply, error)
- func (c *Client) AuthorizeVote(av *www.AuthorizeVote) (*www.AuthorizeVoteReply, error)
- func (c *Client) BatchProposals(bp *www.BatchProposals) (*www.BatchProposalsReply, error)
- func (c *Client) BatchVoteSummary(bvs *www.BatchVoteSummary) (*www.BatchVoteSummaryReply, error)
- func (c *Client) CMSEditUser(uui cms.EditUser) (*cms.EditUserReply, error)
- func (c *Client) CMSManageUser(uui cms.CMSManageUser) (*cms.CMSManageUserReply, error)
- func (c *Client) CMSPolicy() (*cms.PolicyReply, error)
- func (c *Client) CMSUserDetails(userID string) (*cms.UserDetailsReply, error)
- func (c *Client) CMSUsers(cu *cms.CMSUsers) (*cms.CMSUsersReply, error)
- func (c *Client) CastVotes(b *www.Ballot) (*www.BallotReply, error)
- func (c *Client) CensorComment(cc *www.CensorComment) (*www.CensorCommentReply, error)
- func (c *Client) ChangePassword(cp *www.ChangePassword) (*www.ChangePasswordReply, error)
- func (c *Client) ChangeUsername(cu *www.ChangeUsername) (*www.ChangeUsernameReply, error)
- func (c *Client) Close()
- func (c *Client) CommittedTickets(ct *walletrpc.CommittedTicketsRequest) (*walletrpc.CommittedTicketsResponse, error)
- func (c *Client) DCCComments(token string) (*www.GetCommentsReply, error)
- func (c *Client) DCCDetails(token string) (*cms.DCCDetailsReply, error)
- func (c *Client) EditInvoice(ei *cms.EditInvoice) (*cms.EditInvoiceReply, error)
- func (c *Client) EditProposal(ep *www.EditProposal) (*www.EditProposalReply, error)
- func (c *Client) EditUser(eu *www.EditUser) (*www.EditUserReply, error)
- func (c *Client) GeneratePayouts(gp *cms.GeneratePayouts) (*cms.GeneratePayoutsReply, error)
- func (c *Client) GetAllVetted(gav *www.GetAllVetted) (*www.GetAllVettedReply, error)
- func (c *Client) GetAllVoteStatus() (*www.GetAllVoteStatusReply, error)
- func (c *Client) GetComments(token string) (*www.GetCommentsReply, error)
- func (c *Client) GetDCCs(gd *cms.GetDCCs) (*cms.GetDCCsReply, error)
- func (c *Client) InviteNewUser(inu *cms.InviteNewUser) (*cms.InviteNewUserReply, error)
- func (c *Client) InvoiceComments(token string) (*www.GetCommentsReply, error)
- func (c *Client) InvoiceDetails(token string) (*cms.InvoiceDetailsReply, error)
- func (c *Client) InvoiceExchangeRate(ier *cms.InvoiceExchangeRate) (*cms.InvoiceExchangeRateReply, error)
- func (c *Client) InvoicePayouts(lip *cms.InvoicePayouts) (*cms.InvoicePayoutsReply, error)
- func (c *Client) LikeComment(lc *www.LikeComment) (*www.LikeCommentReply, error)
- func (c *Client) LoadWalletClient() error
- func (c *Client) Login(l *www.Login) (*www.LoginReply, error)
- func (c *Client) Logout() (*www.LogoutReply, error)
- func (c *Client) ManageUser(mu *www.ManageUser) (*www.ManageUserReply, error)
- func (c *Client) Me() (*www.LoginReply, error)
- func (c *Client) NewComment(nc *www.NewComment) (*www.NewCommentReply, error)
- func (c *Client) NewDCC(nd cms.NewDCC) (*cms.NewDCCReply, error)
- func (c *Client) NewDCCComment(nc *www.NewComment) (*www.NewCommentReply, error)
- func (c *Client) NewInvoice(ni *cms.NewInvoice) (*cms.NewInvoiceReply, error)
- func (c *Client) NewProposal(np *www.NewProposal) (*www.NewProposalReply, error)
- func (c *Client) NewUser(nu *www.NewUser) (*www.NewUserReply, error)
- func (c *Client) PayInvoices(pi *cms.PayInvoices) (*cms.PayInvoicesReply, error)
- func (c *Client) Policy() (*www.PolicyReply, error)
- func (c *Client) ProposalBilling(pb *cms.ProposalBilling) (*cms.ProposalBillingReply, error)
- func (c *Client) ProposalDetails(token string, pd *www.ProposalsDetails) (*www.ProposalDetailsReply, error)
- func (c *Client) ProposalOwner(po *cms.ProposalOwner) (*cms.ProposalOwnerReply, error)
- func (c *Client) ProposalPaywallDetails() (*www.ProposalPaywallDetailsReply, error)
- func (c *Client) ProposalPaywallPayment() (*www.ProposalPaywallPaymentReply, error)
- func (c *Client) RegisterUser(ru *cms.RegisterUser) (*cms.RegisterUserReply, error)
- func (c *Client) ResendVerification(rv www.ResendVerification) (*www.ResendVerificationReply, error)
- func (c *Client) ResetPassword(rp *www.ResetPassword) (*www.ResetPasswordReply, error)
- func (c *Client) Secret() (*www.UserError, error)
- func (c *Client) SetDCCStatus(sd *cms.SetDCCStatus) (*cms.SetDCCStatusReply, error)
- func (c *Client) SetInvoiceStatus(sis *cms.SetInvoiceStatus) (*cms.SetInvoiceStatusReply, error)
- func (c *Client) SetProposalStatus(sps *www.SetProposalStatus) (*www.SetProposalStatusReply, error)
- func (c *Client) SignMessages(sm *walletrpc.SignMessagesRequest) (*walletrpc.SignMessagesResponse, error)
- func (c *Client) StartVoteRunoffV2(svr www2.StartVoteRunoff) (*www2.StartVoteRunoffReply, error)
- func (c *Client) StartVoteV2(sv www2.StartVote) (*www2.StartVoteReply, error)
- func (c *Client) SupportOpposeDCC(sd cms.SupportOpposeDCC) (*cms.SupportOpposeDCCReply, error)
- func (c *Client) TokenInventory() (*www.TokenInventoryReply, error)
- func (c *Client) UpdateUserKey(uuk *www.UpdateUserKey) (*www.UpdateUserKeyReply, error)
- func (c *Client) UserCommentsLikes(token string) (*www.UserCommentsLikesReply, error)
- func (c *Client) UserDetails(userID string) (*www.UserDetailsReply, error)
- func (c *Client) UserInvoices(up *cms.UserInvoices) (*cms.UserInvoicesReply, error)
- func (c *Client) UserPaymentsRescan(upr *www.UserPaymentsRescan) (*www.UserPaymentsRescanReply, error)
- func (c *Client) UserProposalCredits() (*www.UserProposalCreditsReply, error)
- func (c *Client) UserProposals(up *www.UserProposals) (*www.UserProposalsReply, error)
- func (c *Client) UserSubContractors(usc *cms.UserSubContractors) (*cms.UserSubContractorsReply, error)
- func (c *Client) Users(u *www.Users) (*www.UsersReply, error)
- func (c *Client) VerifyNewUser(vnu *www.VerifyNewUser) (*www.VerifyNewUserReply, error)
- func (c *Client) VerifyResetPassword(vrp www.VerifyResetPassword) (*www.VerifyResetPasswordReply, error)
- func (c *Client) VerifyUpdateUserKey(vuuk *www.VerifyUpdateUserKey) (*www.VerifyUpdateUserKeyReply, error)
- func (c *Client) VerifyUserPayment() (*www.VerifyUserPaymentReply, error)
- func (c *Client) Version() (*www.VersionReply, error)
- func (c *Client) VoteDetailsV2(token string) (*www2.VoteDetailsReply, error)
- func (c *Client) VoteResults(token string) (*www.VoteResultsReply, error)
- func (c *Client) VoteStatus(token string) (*www.VoteStatusReply, error)
- func (c *Client) WalletAccounts() (*walletrpc.AccountsResponse, error)
- type Config
- func (cfg *Config) LoadIdentity(username string) (*identity.FullIdentity, error)
- func (cfg *Config) SaveCSRF(csrf string) error
- func (cfg *Config) SaveCookies(cookies []*http.Cookie) error
- func (cfg *Config) SaveIdentity(user string, id *identity.FullIdentity) error
- func (cfg *Config) SaveLoggedInUsername(username string) error
- type LoginCmd
- type LogoutCmd
- type ManageUserCmd
- type MeCmd
- type NewCommentCmd
- type ResetPasswordCmd
- type SecretCmd
- type UpdateUserKeyCmd
- type UsersCmd
- type VersionCmd
Constants ¶
const CensorCommentHelpMsg = `` /* 665-byte string literal not displayed */
CensorCommentHelpMsg is the output of the help command when 'censorcomment' is specified.
const ChangePasswordHelpMsg = `` /* 354-byte string literal not displayed */
ChangePasswordHelpMsg is the output of the help command when 'changepassword' is specified.
const LoginHelpMsg = `` /* 829-byte string literal not displayed */
LoginHelpMsg is the output for the help command when 'login' is specified.
const LogoutHelpMsg = `logout
Logout as a user or admin.
Arguments:
None
Result:
{}`
LogoutHelpMsg is the output of the help command when 'logout' is specified.
const ManageUserHelpMsg = `` /* 862-byte string literal not displayed */
ManageUserHelpMsg is the output of the help command when 'edituser' is specified.
const MeHelpMsg = `` /* 920-byte string literal not displayed */
MeHelpMsg is the output of the help command when 'me' is specified.
const NewCommentHelpMsg = `` /* 1305-byte string literal not displayed */
NewCommentHelpMsg is the output of the help command when 'newcomment' is specified.
const ResetPasswordHelpMsg = `` /* 270-byte string literal not displayed */
ResetPasswordHelpMsg is the output of the help command when 'resetpassword' is specified.
const UpdateUserKeyHelpMsg = `` /* 152-byte string literal not displayed */
UpdateUserKeyHelpMsg is the output of the help command when 'updateuserkey' is specified.
const UsersHelpMsg = `` /* 1185-byte string literal not displayed */
UsersHelpMsg is the output of the help command when 'users' is specified.
const VersionHelpMsg = `` /* 265-byte string literal not displayed */
VersionHelpMsg is the output of the help command when 'version' is specified.
Variables ¶
var ChangeUsernameHelpMsg = `` /* 333-byte string literal not displayed */
ChangeUsernameHelpMsg is the output of the help command when 'changeusername' is specified.
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 ¶
DigestSHA3 returns the hex encoded SHA3-256 of a string.
func MerkleRoot ¶
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 SignedMerkleRoot ¶
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 (*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 ¶
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 ¶
CMSUsers retrieves a list of cms users that adhere to the specified filtering parameters.
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) CommittedTickets ¶
func (c *Client) CommittedTickets(ct *walletrpc.CommittedTicketsRequest) (*walletrpc.CommittedTicketsResponse, error)
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) 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 ¶
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 ¶
LoadWalletClient connects to a dcrwallet instance.
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) 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) 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) 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 ¶
func (c *Client) SignMessages(sm *walletrpc.SignMessagesRequest) (*walletrpc.SignMessagesResponse, error)
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 ¶
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 ¶
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 ¶
LoadConfig initializes and parses the config using a config file and command line options.
The configuration proceeds as follows:
- Start with a default config with sane settings
- Pre-parse the command line to check for an alternative config file
- Load configuration file overwriting defaults with any specified options
- 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) SaveCookies ¶
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 ¶
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.
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 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 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.
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.