common

package
v0.0.0-...-cb6fcfe Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachGeneralRoutes

func AttachGeneralRoutes(r *mux.Router)

func Cache

func Cache(rw http.ResponseWriter, r *http.Request)

func CreateUserRouter

func CreateUserRouter() *mux.Router

CreateUserRouter will generate a new subrouter prefixed with `/user`. This intends to be used for anything relating to an external user eg. eagate.

func ForceUpdatePost

func ForceUpdatePost(rw http.ResponseWriter, r *http.Request)

func LoginGet

func LoginGet(rw http.ResponseWriter, r *http.Request)

LoginGet will retrieve any relations between the requester and the database. This may produce multiple relations in the case a user has linked multiple accounts. Any stored cookies will be nullified.

func LoginPost

func LoginPost(rw http.ResponseWriter, r *http.Request)

LoginPost will attempt to login to eagate using the supplied credentials. This will not check the current user state, which if exists, will have its cookie updated and web user replaced (if applicable).

func LogoutPost

func LogoutPost(rw http.ResponseWriter, r *http.Request)

func PutBstUser

func PutBstUser(rw http.ResponseWriter, r *http.Request)

func RetrieveEaGateUsernamesForRequest

func RetrieveEaGateUsernamesForRequest(r *http.Request) (usernames []string, err bst_models.Error)

tryGetEagateUsers will attempt to load any eagate users linked to the auth0 account provided in the request.

func Status

func Status(rw http.ResponseWriter, r *http.Request)

Status will return any status details for the API. This currently caches eagate and db connections, however these are still regenerated every page load. TODO: use proper caching with timed expiry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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