api

package
v0.0.0-...-ec82de7 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 17 Imported by: 0

README

gow/api

ya

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeFileHandler

func ServeFileHandler(box *packr.Box, filename string) http.Handler

ServeFileHandler —

Types

type API

type API struct {
	Router *pat.PatternServeMux
	DB     *sql.DB
	Token  string
}

API —

func (*API) AuthorizationMiddleware

func (API *API) AuthorizationMiddleware(handler http.Handler) http.Handler

AuthorizationMiddleware —

func (*API) ConnectDB

func (API *API) ConnectDB(dialect string, dbPath string) *sql.DB

ConnectDB — create db instance

func (*API) Init

func (API *API) Init(config *config.Config)

Init — Initialize api, setting up router & db

func (*API) MountRouters

func (API *API) MountRouters()

MountRouters —

func (*API) Run

func (API *API) Run(host string, port string)

Run — Run server based on selected port

func (*API) SendToSlackMiddleware

func (API *API) SendToSlackMiddleware(handler http.Handler) http.Handler

SendToSlackMiddleware —

type StaticHandler

type StaticHandler func(w http.ResponseWriter, r *http.Request) error

StaticHandler —

func ServeFile

func ServeFile(box *packr.Box, filename string) StaticHandler

ServeFile —

func (StaticHandler) ServeHTTP

func (h StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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