Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(onerr func(c *gin.Context)) gin.HandlerFunc
AuthMiddleware middleware to check auth token
func BasicMiddleware ¶
func BasicMiddleware() gin.HandlerFunc
BasicMiddleware middleware of gin to handler OPTIONS and cors
Types ¶
type HTTPServer ¶
type HTTPServer struct { Config *db.SparrowConfig // contains filtered or unexported fields }
HTTPServer holds HTTP server configuration and routes
func NewHTTPServer ¶
func NewHTTPServer(config *db.SparrowConfig, dbm *db.DBManager) HTTPServer
NewHTTPServer returns new HTTPServer
type Response ¶
type Response struct { Database string `json:"database"` Content map[string]interface{} `json:"content"` Error []string `json:"error"` }
Response HTTP response
func (*Response) AddContent ¶
AddContent adds object to query return values
func (*Response) AddErrorStr ¶
AddErrorStr adds error message as string
type ServeHandler ¶
type ServeHandler struct {
// contains filtered or unexported fields
}
ServeHandler holds main http methods
func NewServeHandler ¶
func NewServeHandler(dbm *db.DBManager) *ServeHandler
NewServeHandler returns new ServeHandler
Click to show internal directories.
Click to hide internal directories.