web

package
v0.0.0-...-f5e88d7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BHandler

type BHandler struct {
	Path string
	Func http.HandlerFunc
}

BHandler is handler path and func

type Middleware

type Middleware func() mw.Handler

Middleware is handler func for middleware

type Web

type Web struct {
	Mux        *http.ServeMux
	Router     map[string][]BHandler
	Middleware []Middleware
}

Web is web object including Mux, Router, Middleware

func New

func New() *Web

New is to create Web object

func (*Web) AttachProfiler

func (w *Web) AttachProfiler()

AttachProfiler is for profiler pages

func (*Web) Delete

func (w *Web) Delete(path string, f http.HandlerFunc)

Delete is to set delete request

func (*Web) Get

func (w *Web) Get(path string, f http.HandlerFunc)

Get is to set get request

func (*Web) Handler

func (w *Web) Handler(res http.ResponseWriter, req *http.Request)

endpoint of router

func (*Web) Head

func (w *Web) Head(path string, f http.HandlerFunc)

Head is to set head request

func (*Web) Options

func (w *Web) Options(path string, f http.HandlerFunc)

Options is to set options request

func (*Web) Patch

func (w *Web) Patch(path string, f http.HandlerFunc)

Patch is to set patch request

func (*Web) Post

func (w *Web) Post(path string, f http.HandlerFunc)

Post is to set post request

func (*Web) Put

func (w *Web) Put(path string, f http.HandlerFunc)

Put is to set put request

func (*Web) SetStaticFiles

func (w *Web) SetStaticFiles()

SetStaticFiles is to set static files

func (*Web) StartServer

func (w *Web) StartServer(port int, cert, key string)

StartServer is to start server with setting handler

func (*Web) Use

func (w *Web) Use(m Middleware)

Use is to set middleware you want

Jump to

Keyboard shortcuts

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