app

package
v0.0.0-...-8e98fc1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Router *mux.Router
	DB     *gorm.DB
}

App has a Router and a Database

func (*App) Get

func (a *App) Get(path string, f func(w http.ResponseWriter, r *http.Request))

Get wraps the router for GET HTTP method

func (*App) Initialize

func (a *App) Initialize(config *config.Config)

Initialize initializes the app with predefined configuration

func (*App) Post

func (a *App) Post(path string, f func(w http.ResponseWriter, r *http.Request))

Post wraps the router for POST HTTP method

func (*App) Run

func (a *App) Run(host string)

Run the app on its router

type RequestHandlerFunction

type RequestHandlerFunction func(db *gorm.DB, w http.ResponseWriter, r *http.Request)

RequestHandlerFunction defines a handler function for an HTTP request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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