api

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(c *gin.Context)

AuthMiddleware is gin middleware, thats validates JWT token.

Types

type GenericError

type GenericError struct {
	// Error massage.
	Error string `json:"error"`
}

GenericError error model.

swagger:model

type Server

type Server struct {
	Router *gin.Engine
	DB     *sqlx.DB
	DBConn *sql.Conn
}

Server is composition of router and DB instances. swagger:ignore

func GetServer

func GetServer(user, password, database, host, port string) *Server

GetServer returns server instance.

func (*Server) ListenAndServe

func (server *Server) ListenAndServe()

ListenAndServe server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL