Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Users holds map of our users (ID->User). In real life, access should be protected! Users map[int64]*User )
Functions ¶
Types ¶
type RequestError ¶
type RequestError struct { // ErrorCode is the code of your error; not exported to json. Added only for demonstration purposes. ErrorCode int `json:"-"` // Message is the description of error; exported to json Message string `json:"message"` }
RequestError describes error that occurred in application
type User ¶
type User struct { // ID defines the user ID. Should be unique per users set ID int64 `json:"id" example:"1" format:"int64"` // Name is the name of a user Name string `json:"name" example:"Dmytro" minLength:"1" maxLength:"30"` // Country is the country where user lives Country string `json:"country" example:"Ukraine"` }
User defines user struct
Click to show internal directories.
Click to hide internal directories.