express

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Express

type Express struct {
	*types.ServeMux
	// contains filtered or unexported fields
}

func NewExpress

func NewExpress(_options *options.Config) *Express

Create a new Express instance.

func (*Express) AuthorizeRequests

func (es *Express) AuthorizeRequests(handle httprouter.Handle) httprouter.Handle

Attach global protection to HTTP routes, to verify the API key.

func (*Express) CanAccess

func (es *Express) CanAccess(r *http.Request, router httprouter.Params) bool

Check is an incoming r can access the api.

func (*Express) GetAppId

func (es *Express) GetAppId(router httprouter.Params) string

Get the appId from the URL

func (*Express) GetAuthKey

func (es *Express) GetAuthKey(r *http.Request) string

Get the api token from the r.

func (*Express) Route

func (es *Express) Route() *httprouter.Router

func (*Express) ServeHTTP

func (es *Express) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Express) UnauthorizedResponse

func (es *Express) UnauthorizedResponse(w http.ResponseWriter, r *http.Request)

Handle unauthorized rs.

func (*Express) Use

func (es *Express) Use(middlewares ...Next)

type Next

type Next func(http.ResponseWriter, *http.Request, func())

Jump to

Keyboard shortcuts

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