Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultInternalError = `` /* 181-byte string literal not displayed */
)
DefaultInternalError JSON string response
Variables ¶
View Source
var ( // Database export glbal connection Database model.DB //Logger global way to log things Logger logger )
Functions ¶
Types ¶
type ArticlePayload ¶
type ArticlePayload struct { Data struct { ID uint64 `json: "ID"` Title string `json: "Title"` Time string `json: "Time"` Author string `json: "Author"` Content string `json: "Content"` IDCategory uint64 `json: "ID_Category"` } }
ArticlePayload struct type to decode incomming post/put request body json
type CategoryPayload ¶
CategoryPayload struct type to decode incomming post/put request body json
type ErrData ¶
type ErrData struct {
Message string
}
ErrData hold the body json that will be written to the ReponseWriter
type ErrServer ¶
type ErrServer struct {
Data ErrData
}
ErrServer playload does not implment the error interface because we use just to fill the http response body
func NewErrServer ¶
NewErrServer returns a new ErrServer struct for marshaling json
Click to show internal directories.
Click to hide internal directories.