api

package
v0.0.0-...-bd4b760 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func InitAuth

func InitAuth(username, password, realm string) *Auth

func (*Auth) Authenticated

func (auth *Auth) Authenticated(username, password string) bool

Returns true if the credentials are correct

func (*Auth) Base64Authenticated

func (auth *Auth) Base64Authenticated(s string) bool

Just like the Authenticated function - except it expects the argument to be in the following format - Base64(username:password) Returns true if the credentials are correct

func (*Auth) BasicAuth

func (auth *Auth) BasicAuth(nextHandler http.HandlerFunc) http.HandlerFunc

Copied from https://stackoverflow.com/a/39591234

func (*Auth) IsDisabled

func (auth *Auth) IsDisabled() bool

type CookieGenerator

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

func InitCookieGenerator

func InitCookieGenerator(next func(w http.ResponseWriter, r *http.Request)) *CookieGenerator

func (CookieGenerator) ServeHTTP

func (s CookieGenerator) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RestApi

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

func InitRestApi

func InitRestApi(hub messaging.MessageHub) *RestApi

func (*RestApi) ExtendSession

func (api *RestApi) ExtendSession(w http.ResponseWriter, r *http.Request)

func (*RestApi) Game

func (api *RestApi) Game(w http.ResponseWriter, r *http.Request)

func (*RestApi) Quiz

func (api *RestApi) Quiz(w http.ResponseWriter, r *http.Request)

func (*RestApi) ServeHTTP

func (api *RestApi) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*RestApi) Session

func (api *RestApi) Session(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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