types

package
v4.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ShorterDesc maps the short description to there respective vote status type.

Functions

func VotesStatuses

func VotesStatuses() map[VoteStatusType]string

VotesStatuses returns the ShorterDesc map contents exclusive of Invalid and Doesn't exist statuses.

Types

type AttachmentFile

type AttachmentFile struct {
	Name      string `json:"name"`
	MimeType  string `json:"mime"`
	DigestKey string `json:"digest"`
	Payload   string `json:"payload"`
}

AttachmentFile are files and documents submitted as proposal details. https://github.com/decred/politeia/blob/master/politeiawww/api/v1/api.md#file

type CensorshipRecord

type CensorshipRecord struct {
	Token      string `json:"token" storm:"unique"`
	MerkleRoot string `json:"merkle"`
	Signature  string `json:"signature"`
}

CensorshipRecord is an entry that was created when the proposal was submitted. https://github.com/decred/politeia/blob/master/politeiawww/api/v1/api.md#censorship-record

type ProposalInfo

type ProposalInfo struct {
	ID              int                `json:"id" storm:"id,increment"`
	Name            string             `json:"name"`
	State           ProposalStateType  `json:"state"`
	Status          ProposalStatusType `json:"status"`
	Timestamp       uint64             `json:"timestamp"`
	UserID          string             `json:"userid"`
	Username        string             `json:"username"`
	PublicKey       string             `json:"publickey"`
	Signature       string             `json:"signature"`
	Version         string             `json:"version"`
	Censorship      CensorshipRecord   `json:"censorshiprecord"`
	NumComments     int32              `json:"numcomments"`
	StatusChangeMsg string             `json:"statuschangemessage"`
	PublishedDate   uint64             `json:"publishedat" storm:"index"`
	CensoredDate    uint64             `json:"censoredat"`
	AbandonedDate   uint64             `json:"abandonedat"`
	ProposalVotes   `json:"votes"`
}

ProposalInfo holds the proposal details as document here https://github.com/decred/politeia/blob/master/politeiawww/api/v1/api.md#proposal. It also holds the votes status details. The ID field is auto incremented by the db.

type ProposalStateType

type ProposalStateType int8

ProposalStateType defines the proposal state entry.

const (
	// InvalidState defines the invalid state proposals.
	InvalidState ProposalStateType = iota

	// UnvettedState defines the unvetted state proposals and includes proposals
	// with a status of:
	//   * PropStatusNotReviewed
	//   * PropStatusUnreviewedChanges
	//   * PropStatusCensored
	UnvettedState

	// VettedState defines the vetted state proposals and includes proposals
	// with a status of:
	//   * PropStatusPublic
	//   * PropStatusAbandoned
	VettedState
	UnknownState
)

func ProposalStateFromStr

func ProposalStateFromStr(val string) ProposalStateType

ProposalStateFromStr converts the string into ProposalStateType value.

func (ProposalStateType) String

func (f ProposalStateType) String() string

type ProposalStatusType

type ProposalStatusType piapi.PropStatusT

ProposalStatusType defines the various proposal statuses available as referenced in https://github.com/decred/politeia/blob/master/politeiawww/api/v1/v1.go

func (ProposalStatusType) String

func (p ProposalStatusType) String() string

type ProposalVotes

type ProposalVotes struct {
	Token              string         `json:"token"`
	VoteStatus         VoteStatusType `json:"status"`
	VoteResults        []Results      `json:"optionsresult"`
	TotalVotes         int64          `json:"totalvotes"`
	Endheight          string         `json:"endheight"`
	NumOfEligibleVotes int64          `json:"numofeligiblevotes"`
	QuorumPercentage   uint32         `json:"quorumpercentage"`
	PassPercentage     uint32         `json:"passpercentage"`
}

ProposalVotes defines the proposal status(Votes infor for the public proposals). https://github.com/decred/politeia/blob/master/politeiawww/api/v1/api.md#proposal-vote-status

type Proposals

type Proposals struct {
	Data []*ProposalInfo `json:"proposals"`
}

Proposals defines an array of proposals as returned by RouteAllVetted.

type Results

type Results struct {
	Option        VoteOption `json:"option"`
	VotesReceived int64      `json:"votesreceived"`
}

Results defines the actual vote count info per the votes choices available.

type VoteOption

type VoteOption struct {
	OptionID    string `json:"id"`
	Description string `json:"description"`
	Bits        int32  `json:"bits"`
}

VoteOption defines the actual high level vote results for the specific agenda.

type VoteStatusType

type VoteStatusType piapi.PropVoteStatusT

VoteStatusType defines the various vote statuses available as referenced in https://github.com/decred/politeia/blob/master/politeiawww/api/v1/v1.go

func (VoteStatusType) LongDesc

func (s VoteStatusType) LongDesc() string

LongDesc returns the long vote status description.

func (VoteStatusType) ShortDesc

func (s VoteStatusType) ShortDesc() string

ShortDesc returns the shorter vote status description.

type Votes

type Votes struct {
	Data []ProposalVotes `json:"votesstatus"`
}

Votes defines a slice of VotesStatuses as returned by RouteAllVoteStatus.

Jump to

Keyboard shortcuts

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