app

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteData

func WriteData(data string, code int, w http.ResponseWriter) int

WriteData - Return response message and an HTTP Status Code upon receiving a request.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App - API config for DB, Mux Router and CORS

func (*App) Delete

func (app *App) Delete(path string, f routeHandler)

Delete - Setting a Delete route and its associated handler

func (*App) Get

func (app *App) Get(path string, f routeHandler)

Get - Setting a GET route and its associated handler

func (*App) Handle

func (app *App) Handle(h hdlr, verifyRequest bool) func(w http.ResponseWriter, r *http.Request)

Handle - Wrapper function to return a base Handler function

func (*App) Initialize

func (app *App) Initialize(dbConfig *config.DBConfig, redisConfig *config.RedisConfig, adminConfig *model.User)

Initialize - Server initialization Database, CORS and the admin settings are initialized

func (*App) Post

func (app *App) Post(path string, f routeHandler)

Post - Setting a POST route and its associated handler

func (*App) Run

func (app *App) Run(port string)

Run - Main run function to startup API serve

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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