Documentation ¶
Overview ¶
Package tranapp maintains the app layer api for the tran domain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Log *logger.Logger DB *sqlx.DB UserBus *userbus.Business ProductBus *productbus.Business AuthClient *authclient.Client }
Config contains all the mandatory systems required by handlers.
type NewProduct ¶
type NewProduct struct { Name string `json:"name" validate:"required"` Cost float64 `json:"cost" validate:"required,gte=0"` Quantity int `json:"quantity" validate:"required,gte=1"` }
NewProduct is what we require from clients when adding a Product.
func (NewProduct) Validate ¶
func (app NewProduct) Validate() error
Validate checks the data in the model is considered clean.
type NewTran ¶
type NewTran struct { Product NewProduct `json:"product"` User NewUser `json:"user"` }
NewTran represents an example of cross domain transaction at the application layer.
type NewUser ¶
type NewUser 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"` }
NewUser contains information needed to create a new user.
Click to show internal directories.
Click to hide internal directories.