Documentation ¶
Index ¶
- type ProposalPostStruct
- type ProposalResource
- func (r *ProposalResource) Get(context smolder.APIContext, request *restful.Request, ...)
- func (r *ProposalResource) GetAuthRequired() bool
- func (r *ProposalResource) GetByIDs(context smolder.APIContext, request *restful.Request, ...)
- func (r *ProposalResource) GetByIDsAuthRequired() bool
- func (r *ProposalResource) GetDoc() string
- func (r *ProposalResource) GetParams() []*restful.Parameter
- func (r *ProposalResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *ProposalResource) PostAuthRequired() bool
- func (r *ProposalResource) PostDoc() string
- func (r *ProposalResource) PostParams() []*restful.Parameter
- func (r *ProposalResource) Put(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *ProposalResource) PutAuthRequired() bool
- func (r *ProposalResource) PutDoc() string
- func (r *ProposalResource) PutParams() []*restful.Parameter
- func (r *ProposalResource) Reads() interface{}
- func (r *ProposalResource) Register(container *restful.Container, config smolder.APIConfig, ...)
- func (r *ProposalResource) Returns() interface{}
- func (r *ProposalResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
- type ProposalResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProposalPostStruct ¶
type ProposalPostStruct struct { Proposal struct { Title string `json:"title"` Description string `json:"description"` Activities string `json:"activities"` Contact string `json:"contact"` Recipient string `json:"recipient"` Recipient2 string `json:"recipient2"` Value uint64 `json:"value"` RealValue uint64 `json:"realvalue"` Moderated bool `json:"moderated"` Starts time.Time `json:"starts"` FinishedDate time.Time `json:"finished_date"` } `json:"proposal"` }
ProposalPostStruct holds all values of an incoming POST request
type ProposalResource ¶
ProposalResource is the resource responsible for /proposals
func (*ProposalResource) Get ¶
func (r *ProposalResource) Get(context smolder.APIContext, request *restful.Request, response *restful.Response, params map[string][]string)
Get sends out items matching the query parameters
func (*ProposalResource) GetAuthRequired ¶
func (r *ProposalResource) GetAuthRequired() bool
GetAuthRequired returns true because all requests need authentication
func (*ProposalResource) GetByIDs ¶
func (r *ProposalResource) GetByIDs(context smolder.APIContext, request *restful.Request, response *restful.Response, ids []string)
GetByIDs sends out all items matching a set of IDs
func (*ProposalResource) GetByIDsAuthRequired ¶
func (r *ProposalResource) GetByIDsAuthRequired() bool
GetByIDsAuthRequired returns true because all requests need authentication
func (*ProposalResource) GetDoc ¶
func (r *ProposalResource) GetDoc() string
GetDoc returns the description of this API endpoint
func (*ProposalResource) GetParams ¶
func (r *ProposalResource) GetParams() []*restful.Parameter
GetParams returns the parameters supported by this API endpoint
func (*ProposalResource) Post ¶
func (r *ProposalResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)
Post processes an incoming POST (create) request
func (*ProposalResource) PostAuthRequired ¶
func (r *ProposalResource) PostAuthRequired() bool
PostAuthRequired returns true because all requests need authentication
func (*ProposalResource) PostDoc ¶
func (r *ProposalResource) PostDoc() string
PostDoc returns the description of this API endpoint
func (*ProposalResource) PostParams ¶
func (r *ProposalResource) PostParams() []*restful.Parameter
PostParams returns the parameters supported by this API endpoint
func (*ProposalResource) Put ¶
func (r *ProposalResource) Put(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)
Put processes an incoming PUT (update) request
func (*ProposalResource) PutAuthRequired ¶
func (r *ProposalResource) PutAuthRequired() bool
PutAuthRequired returns true because all requests need authentication
func (*ProposalResource) PutDoc ¶
func (r *ProposalResource) PutDoc() string
PutDoc returns the description of this API endpoint
func (*ProposalResource) PutParams ¶
func (r *ProposalResource) PutParams() []*restful.Parameter
PutParams returns the parameters supported by this API endpoint
func (*ProposalResource) Reads ¶
func (r *ProposalResource) Reads() interface{}
Reads returns the model that will be read by POST, PUT & PATCH operations
func (*ProposalResource) Register ¶
func (r *ProposalResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)
Register this resource with the container to setup all the routes
func (*ProposalResource) Returns ¶
func (r *ProposalResource) Returns() interface{}
Returns returns the model that will be returned
func (*ProposalResource) Validate ¶
func (r *ProposalResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
type ProposalResponse ¶
type ProposalResponse struct { smolder.Response Proposals []proposalInfoResponse `json:"proposals,omitempty"` // contains filtered or unexported fields }
ProposalResponse is the common response to 'proposal' requests
func (*ProposalResponse) AddProposal ¶
func (r *ProposalResponse) AddProposal(proposal *db.Proposal)
AddProposal adds a proposal to the response
func (*ProposalResponse) EmptyResponse ¶
func (r *ProposalResponse) EmptyResponse() interface{}
EmptyResponse returns an empty API response for this endpoint if there's no data to respond with
func (*ProposalResponse) Init ¶
func (r *ProposalResponse) Init(context smolder.APIContext)
Init a new response