Documentation ¶
Index ¶
Constants ¶
View Source
const ( IDKey = "id" // IDKey is the key for poll IDs BasePath = "/:" + util.APIVersionKey + "/polls" // BasePath is the base API path for making poll requests through v1 or v2 of the api (for mastodon API compatibility) PollWithID = BasePath + "/:" + IDKey // PollVotesWithID = BasePath + "/:" + IDKey + "/votes" // )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(processor *processing.Processor) *Module
func (*Module) PollGETHandler ¶
PollGETHandler swagger:operation GET /api/v1/polls/{id} poll
View poll with given ID.
--- tags: - polls produces: - application/json parameters: - name: id type: string description: Target poll ID. in: path required: true security: - OAuth2 Bearer: - read:statuses responses: '200': description: "The requested poll." schema: "$ref": "#/definitions/poll" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) PollVotePOSTHandler ¶
PollVotePOSTHandler swagger:operation POST /api/v1/polls/{id}/votes pollVote
Vote with choices in the given poll.
--- tags: - polls produces: - application/json parameters: - name: id type: string description: Target poll ID. in: path required: true - name: choices type: array items: type: integer description: Poll choice indices on which to vote. in: formData required: true security: - OAuth2 Bearer: - write:statuses responses: '200': description: "The updated poll with user vote choices." schema: "$ref": "#/definitions/poll" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '422': description: unprocessable entity '500': description: internal server error
Click to show internal directories.
Click to hide internal directories.