Documentation
¶
Index ¶
- Variables
- func Serve(stationURL string, handler http.Handler) error
- type LoginMiddleware
- func (lm *LoginMiddleware) AddSessionId(id string)
- func (lm *LoginMiddleware) HasSessionId(id string) bool
- func (lm *LoginMiddleware) IsLocalhost(r *http.Request) bool
- func (lm *LoginMiddleware) IsPasswordRequired() bool
- func (lm *LoginMiddleware) IsValidLogin(r *http.Request) bool
- func (lm *LoginMiddleware) IsValidSession(r *http.Request) bool
- func (lm *LoginMiddleware) RedirectToLogin(w http.ResponseWriter, r *http.Request)
- func (lm *LoginMiddleware) SetCookiesAndRedirect(w http.ResponseWriter, r *http.Request)
- func (lm *LoginMiddleware) Wrap(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeout = 5 * time.Second
View Source
var WWW embed.FS
Functions ¶
Types ¶
type LoginMiddleware ¶
type LoginMiddleware struct {
// set login password
// empty value removes password check
Password string
// optional, fallback to "UFOSID" if empty
SessionKey string
// optional, fallback to "password" if empty
PasswordKey string
// contains filtered or unexported fields
}
func (*LoginMiddleware) AddSessionId ¶
func (lm *LoginMiddleware) AddSessionId(id string)
func (*LoginMiddleware) HasSessionId ¶
func (lm *LoginMiddleware) HasSessionId(id string) bool
func (*LoginMiddleware) IsLocalhost ¶
func (lm *LoginMiddleware) IsLocalhost(r *http.Request) bool
func (*LoginMiddleware) IsPasswordRequired ¶
func (lm *LoginMiddleware) IsPasswordRequired() bool
func (*LoginMiddleware) IsValidLogin ¶
func (lm *LoginMiddleware) IsValidLogin(r *http.Request) bool
func (*LoginMiddleware) IsValidSession ¶
func (lm *LoginMiddleware) IsValidSession(r *http.Request) bool
func (*LoginMiddleware) RedirectToLogin ¶
func (lm *LoginMiddleware) RedirectToLogin(w http.ResponseWriter, r *http.Request)
func (*LoginMiddleware) SetCookiesAndRedirect ¶
func (lm *LoginMiddleware) SetCookiesAndRedirect(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.