Documentation ¶
Index ¶
- Variables
- type Configuration
- type Context
- func (c *Context) Info(message interface{})
- func (c *Context) ResponseWithJson(w http.ResponseWriter, httpCode int, code string, status string, ...)
- func (c *Context) SendBadRequest(w http.ResponseWriter, code string, message string)
- func (c *Context) SendForbidden(w http.ResponseWriter, code string, message string)
- func (c *Context) SendInternalServerError(w http.ResponseWriter, code string, message string)
- func (c *Context) SendSuccess(w http.ResponseWriter, code string, message string, payload interface{})
- func (c *Context) SendUnauthorized(w http.ResponseWriter, code string, message string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Normal colors NBlack = []byte{'\033', '[', '3', '0', 'm'} NRed = []byte{'\033', '[', '3', '1', 'm'} NGreen = []byte{'\033', '[', '3', '2', 'm'} NYellow = []byte{'\033', '[', '3', '3', 'm'} NBlue = []byte{'\033', '[', '3', '4', 'm'} NMagenta = []byte{'\033', '[', '3', '5', 'm'} NCyan = []byte{'\033', '[', '3', '6', 'm'} NWhite = []byte{'\033', '[', '3', '7', 'm'} // Bright colors BBlack = []byte{'\033', '[', '3', '0', ';', '1', 'm'} BRed = []byte{'\033', '[', '3', '1', ';', '1', 'm'} BGreen = []byte{'\033', '[', '3', '2', ';', '1', 'm'} BYellow = []byte{'\033', '[', '3', '3', ';', '1', 'm'} BBlue = []byte{'\033', '[', '3', '4', ';', '1', 'm'} BMagenta = []byte{'\033', '[', '3', '5', ';', '1', 'm'} BCyan = []byte{'\033', '[', '3', '6', ';', '1', 'm'} BWhite = []byte{'\033', '[', '3', '7', ';', '1', 'm'} Reset = []byte{'\033', '[', '0', 'm'} )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Context ¶
type Context struct { Debug bool Configuration Configuration Validator *validator.Validate MySqlDsn string PostgreDsn string RedisDsn string MongoDsn string }
func (*Context) ResponseWithJson ¶
func (*Context) SendBadRequest ¶
func (c *Context) SendBadRequest(w http.ResponseWriter, code string, message string)
func (*Context) SendForbidden ¶
func (c *Context) SendForbidden(w http.ResponseWriter, code string, message string)
func (*Context) SendInternalServerError ¶
func (c *Context) SendInternalServerError(w http.ResponseWriter, code string, message string)
func (*Context) SendSuccess ¶
func (c *Context) SendSuccess(w http.ResponseWriter, code string, message string, payload interface{})
func (*Context) SendUnauthorized ¶
func (c *Context) SendUnauthorized(w http.ResponseWriter, code string, message string)
Click to show internal directories.
Click to hide internal directories.