Documentation
¶
Overview ¶
Package trangrp maintains the group of handlers for transaction example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppNewProduct ¶
type AppNewProduct struct {
Name string `json:"name" validate:"required"`
Cost float64 `json:"cost" validate:"required,gte=0"`
Quantity int `json:"quantity" validate:"required,gte=1"`
}
AppNewProduct is what we require from clients when adding a Product.
func (AppNewProduct) Validate ¶
func (app AppNewProduct) Validate() error
Validate checks the data in the model is considered clean.
type AppNewTran ¶
type AppNewTran struct {
Product AppNewProduct `json:"product"`
User AppNewUser `json:"user"`
}
AppNewTran represents an example of cross domain transaction at the application layer.
type AppNewUser ¶
type AppNewUser struct {
Name string `json:"name" validate:"required"`
Email string `json:"email" validate:"required,email"`
Roles []string `json:"roles" validate:"required"`
Department string `json:"department"`
Password string `json:"password" validate:"required"`
PasswordConfirm string `json:"passwordConfirm" validate:"eqfield=Password"`
}
AppNewUser contains information needed to create a new user.
func (AppNewUser) Validate ¶
func (app AppNewUser) Validate() error
Validate checks the data in the model is considered clean.
type AppProduct ¶
type AppProduct struct {
ID string `json:"id"`
UserID string `json:"userID"`
Name string `json:"name"`
Cost float64 `json:"cost"`
Quantity int `json:"quantity"`
DateCreated string `json:"dateCreated"`
DateUpdated string `json:"dateUpdated"`
}
AppProduct represents an individual product.
Click to show internal directories.
Click to hide internal directories.