plug

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &http.Client{}

Functions

func AcceptJSON

func AcceptJSON(h http.Handler) http.Handler

func Auth

func Auth(h http.Handler) http.Handler

func AuthorizeSiteAPI

func AuthorizeSiteAPI(h http.Handler) http.Handler

func AuthorizeStatsAPI

func AuthorizeStatsAPI(h http.Handler) http.Handler

func CORS

func CORS(h http.Handler) http.Handler

func CSRF

func CSRF(h http.Handler) http.Handler

func Captcha

func Captcha(h http.Handler) http.Handler

func FetchFlash

func FetchFlash(h http.Handler) http.Handler

func FetchSession

func FetchSession(h http.Handler) http.Handler
func GetSharedLink(ctx context.Context, slug string) *models.SharedLink

func GetSite

func GetSite(ctx context.Context, domain string) *models.Site

func LastSeen

func LastSeen(h http.Handler) http.Handler

func NOOP

func NOOP(w http.ResponseWriter, r *http.Request)

func PutSecureBrowserHeaders

func PutSecureBrowserHeaders(h http.Handler) http.Handler

func RequestID

func RequestID(h http.Handler) http.Handler

func RequireAccount

func RequireAccount(h http.Handler) http.Handler

func RequireLoggedOut

func RequireLoggedOut(h http.Handler) http.Handler

func SessionTimeout

func SessionTimeout(h http.Handler) http.Handler

Types

type Client

type Client interface {
	Do(*http.Request) (*http.Response, error)
}

type Pipeline

type Pipeline []Plug

func API

func API(ctx context.Context) Pipeline

func Browser

func Browser(ctx context.Context) Pipeline

func InternalStatsAPI

func InternalStatsAPI() Pipeline

func Protect

func Protect() Pipeline
func SharedLink() Pipeline

func (Pipeline) And

func (p Pipeline) And(n ...Plug) Pipeline

func (Pipeline) DELETE

func (p Pipeline) DELETE(re string, f func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) GET

func (p Pipeline) GET(re string, f func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) POST

func (p Pipeline) POST(re string, f func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) PUT

func (p Pipeline) PUT(re string, f func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) Pass

func (p Pipeline) Pass(h http.HandlerFunc) http.Handler

func (Pipeline) Path

func (p Pipeline) Path(method, path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) PathDELETE

func (p Pipeline) PathDELETE(path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) PathGET

func (p Pipeline) PathGET(path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) PathPOST

func (p Pipeline) PathPOST(path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) PathPUT

func (p Pipeline) PathPUT(path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) Prefix

func (p Pipeline) Prefix(path string, handler func(w http.ResponseWriter, r *http.Request)) Plug

func (Pipeline) Re

func (p Pipeline) Re(exp string, method string, f func(w http.ResponseWriter, r *http.Request)) Plug

type Plug

type Plug func(http.Handler) http.Handler

func AuthorizedSiteAccess

func AuthorizedSiteAccess(allowed ...string) Plug

func Favicon

func Favicon(klient Client) Plug

func Firewall

func Firewall(ctx context.Context) Plug

func Ok

func Ok(ok bool, pipe Plug) Plug

func PREFIX

func PREFIX(prefix string, pipe ...Plug) Plug

func Track

func Track() Plug

Jump to

Keyboard shortcuts

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