router

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is what registers the UI routes for handling registration, authentication, and general management of a user's account.

func New

func New(cfg *config.Server, h web.Handler, mw web.Middleware) *Router

func (*Router) RegisterAPI

func (r *Router) RegisterAPI(prefix string, mux *mux.Router, gates ...web.Gate)

RegisterAPI registers the only API route for a user, which is "/user". This will return the currently authenticated user from the request.

func (*Router) RegisterUI

func (r *Router) RegisterUI(mux *mux.Router, csrf func(http.Handler) http.Handler, _ ...web.Gate)

RegisterUI registers the routes for User authentication, and account management against the given mux.Router. The given http.Handler is used for CSRF protection. None of the given gates are applied to any of the registered routes.

Jump to

Keyboard shortcuts

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