Documentation
¶
Overview ¶
Package api is a template API for Crafting Sandbox.
Index ¶
- func BadRequest(c *gin.Context)
- func Database() (*sql.DB, error)
- func Init(ctx Context)
- func InternalServerError(c *gin.Context)
- func NotFound(c *gin.Context)
- func Ping(c *gin.Context)
- func Render(c *gin.Context, indent bool, obj interface{})
- func SetupMySQLConfig()
- type Context
- type Error
- type Route
- type Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest responds with error status code 400, Bad Request.
func InternalServerError ¶
InternalServerError responds with error status code 500, Internal Server Error.
func SetupMySQLConfig ¶
func SetupMySQLConfig()
SetupMySQLConfig updates mysqlConf using environment variables.
Types ¶
type Error ¶
type Error struct { Code int `json:"code"` Status string `json:"status"` Message string `json:"message"` }
Error is a custom error structure.
Click to show internal directories.
Click to hide internal directories.