Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addition ¶
Addition represents the data from the client's request.
func NewAddition ¶
func NewAddition() *Addition
NewAddition is the constructor and, by convention, sets the data to garbage values.
func (*Addition) Bind ¶
Bind is your only opportunity to get data from the request. Returning an error indicates that the request data is completely inscrutable. In such a case, processing will be short-circuited resulting in HTTP 400 Bad Request.
func (*Addition) Reset ¶
func (this *Addition) Reset()
Reset is called by shuttle to prepare the instance for use with the current request. This instance will be re-used over the lifetime of the application.
func (*Addition) Validate ¶
Validate is an opportunity to ensure that the values gathered during Bind are usable. The errors slice provided is pre-initialized and can be directly assigned to, beginning at index 0. The presence of any errors short-circuits processing and results in HTTP 422 Unprocessable Entity.
type Subtraction ¶
type Subtraction struct {
shuttle.BaseInputModel
A int `json:"a"`
B int `json:"b"`
}
func NewSubtraction ¶
func NewSubtraction() *Subtraction
func (*Subtraction) Reset ¶
func (this *Subtraction) Reset()
func (*Subtraction) Validate ¶
func (this *Subtraction) Validate(errors []error) (count int)