rest

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RestParamsType     = "type"
	RestProposalID     = "proposal-id"
	RestDepositor      = "depositor"
	RestVoter          = "voter"
	RestProposalStatus = "status"
	RestNumLimit       = "limit"
)

REST Variable names nolint

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router)

RegisterRoutes - Central function to define routes that get registered by the main application

Types

type PostProposalReq

type PostProposalReq struct {
	BaseReq          rest.BaseReq   `json:"base_req" yaml:"base_req"`
	Title            string         `json:"title" yaml:"title"`             // Title of the proposal
	Description      string         `json:"description" yaml:"description"` // Description of the proposal
	Proposer         sdk.AccAddress `json:"proposer" yaml:"proposer"`       // Address of the proposer
	VotingStartBlock string         `json:"voting_start_block" yaml:"voting_start_block"`
	VotingEndBlock   string         `json:"voting_end_block" yaml:"voting_end_block"`
}

PostProposalReq defines the properties of a proposal request's body.

type ProposalRESTHandler

type ProposalRESTHandler struct {
	SubRoute string
	Handler  func(http.ResponseWriter, *http.Request)
}

ProposalRESTHandler defines a REST handler implemented in another module. The sub-route is mounted on the governance REST handler.

type VoteReq

type VoteReq struct {
	BaseReq rest.BaseReq   `json:"base_req" yaml:"base_req"`
	Voter   sdk.ValAddress `json:"voter" yaml:"voter"`   // address of the voter
	Option  string         `json:"option" yaml:"option"` // option from OptionSet chosen by the voter
}

VoteReq defines the properties of a vote request's body.

Jump to

Keyboard shortcuts

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