Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddPlantRequest ¶
type AddPlantRequest struct {
Plant
}
AddPlantRequest the parameter to be passed to add a Plant.
type AddPlantResponse ¶
type AddPlantResponse struct {
ID string `json:"id"`
}
AddPlantResponse the response to an addition of a Plant.
type AuthnController ¶
AuthnController the Authentication Controller.
func (*AuthnController) Signin ¶
func (ac *AuthnController) Signin(w http.ResponseWriter, r *http.Request)
Signin to authenticate user based on a LoginRequest. It returns a LoginResponse.
type JwtMiddleware ¶
JwtMiddleware encapsulates a service checking a JWT token.
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` }
LoginRequest the login request parameters.
type LoginResponse ¶
type LoginResponse struct {
UserID string `json:"userid" validate:"required"`
}
LoginResponse the login request response.
type Plant ¶
type Plant struct { ID string `json:"id"` Name string `json:"name" validate:"required,max=50"` PlantedDate string `json:"planted_date" validate:"required,datetime=2006-01-02"` Price string `json:"price" validate:"required,max=20"` Reserved string `json:"reserved" validate:"required"` }
Plant contains the base info for plant to be created
type PlantController ¶
PlantController HTTP requests controller.
func (*PlantController) AddPlant ¶
func (pc *PlantController) AddPlant(w http.ResponseWriter, r *http.Request)
AddPlant HTTP endpoint.
func (*PlantController) GetPlant ¶
func (pc *PlantController) GetPlant(w http.ResponseWriter, r *http.Request)
GetPlant HTTP endpoint.
Click to show internal directories.
Click to hide internal directories.