api

package
v0.0.0-...-f920654 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMiddleware

func LogMiddleware(next http.Handler) http.Handler

LogMiddleware ...

func NewJWT

func NewJWT(signingKey []byte) *jwtmiddleware.JWTMiddleware

NewJWT ...

func PanicMiddleware

func PanicMiddleware(next http.Handler) http.Handler

PanicMiddleware ...

func RespondError

func RespondError(w http.ResponseWriter, statusCode int, message string)

RespondError ...

func RespondJSON

func RespondJSON(w http.ResponseWriter, statusCode int, p interface{})

RespondJSON ...

Types

type App

type App struct {
	Router *mux.Router
	DB     *sql.DB
	// contains filtered or unexported fields
}

App ...

func (*App) GetBook

func (a *App) GetBook(w http.ResponseWriter, r *http.Request)

GetBook ...

func (*App) GetBooks

func (a *App) GetBooks(w http.ResponseWriter, r *http.Request)

GetBooks ...

func (*App) GetToken

func (a *App) GetToken(w http.ResponseWriter, r *http.Request)

GetToken ...

func (*App) Initialize

func (a *App) Initialize(user, password, dbname, sslmode, signingKey string)

Initialize ...

func (*App) Run

func (a *App) Run(port string)

Run ...

Jump to

Keyboard shortcuts

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