Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) Authorize(w http.ResponseWriter, r *http.Request) bool
- func (db *Config) Close() error
- func (c *Config) Context(base map[string]any) map[string]any
- func (c *Config) CurrentSite() *v1.Site
- func (c *Config) CurrentUser() *v1.User
- func (c *Config) Flash(w http.ResponseWriter)
- func (db *Config) Get() *ro2.Store
- func (db *Config) GetConfig() *v1.Config
- func (db *Config) HTML(w http.ResponseWriter, t *template.Template, data map[string]any)
- func (db *Config) HTMLCode(code int, w http.ResponseWriter, t *template.Template, data map[string]any)
- func (c *Config) IsLoggedOut(w http.ResponseWriter) bool
- func (c *Config) IsValidCsrf(r *http.Request) bool
- func (db *Config) JSON(w http.ResponseWriter, data any)
- func (db *Config) JSONCode(code int, w http.ResponseWriter, data any)
- func (c *Config) Load(w http.ResponseWriter, r *http.Request)
- func (db *Config) LoadSharedLinkSession(r *http.Request, name string) time.Time
- func (db *Config) Logger() *slog.Logger
- func (c *Config) Login(w http.ResponseWriter) string
- func (c *Config) Logout(w http.ResponseWriter)
- func (db *Config) PasswordMatch(email, pwd string) bool
- func (db *Config) ProcessEvent(r *http.Request) error
- func (c *Config) SaveCaptcha(w http.ResponseWriter)
- func (c *Config) SaveCsrf(w http.ResponseWriter)
- func (c *Config) SaveSession(w http.ResponseWriter)
- func (db *Config) SaveSharedLinkSession(w http.ResponseWriter, name string)
- func (c *Config) SaveSuccessRegister(w http.ResponseWriter, uid uuid.UUID)
- func (c *Config) SessionTimeout(w http.ResponseWriter)
- func (c *Config) SetSite(site *v1.Site)
- func (db *Config) Start(ctx context.Context)
- func (c *Config) Success(msg string)
- func (c *Config) VerifyCaptchaSolution(r *http.Request) bool
- func (c *Config) Wrap(f func(db *Config, w http.ResponseWriter, r *http.Request)) http.HandlerFunc
- type Data
- type Flash
- type Request
- type SessionContext
- func (s *SessionContext) FailFlash(m string) *SessionContext
- func (s *SessionContext) Load(r *http.Request) error
- func (s *SessionContext) LoadBase(r *http.Request, name string) ([]byte, error)
- func (s *SessionContext) SaveSharedLink(w http.ResponseWriter, name string) error
- func (s *SessionContext) SuccessFlash(m string) *SessionContext
Constants ¶
View Source
const MaxAge = 60 * 60 * 24 * 365 * 5
Variables ¶
View Source
var ( True = ptr(true) False = ptr(false) ErrDrop = errors.New("event dropped") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) CurrentSite ¶
func (*Config) CurrentUser ¶
func (*Config) Flash ¶
func (c *Config) Flash(w http.ResponseWriter)
func (*Config) IsLoggedOut ¶
func (c *Config) IsLoggedOut(w http.ResponseWriter) bool
func (*Config) LoadSharedLinkSession ¶
func (*Config) Logout ¶
func (c *Config) Logout(w http.ResponseWriter)
func (*Config) PasswordMatch ¶ added in v1.3.0
func (*Config) SaveCaptcha ¶
func (c *Config) SaveCaptcha(w http.ResponseWriter)
func (*Config) SaveCsrf ¶
func (c *Config) SaveCsrf(w http.ResponseWriter)
func (*Config) SaveSession ¶
func (c *Config) SaveSession(w http.ResponseWriter)
func (*Config) SaveSharedLinkSession ¶
func (db *Config) SaveSharedLinkSession(w http.ResponseWriter, name string)
func (*Config) SaveSuccessRegister ¶
func (c *Config) SaveSuccessRegister(w http.ResponseWriter, uid uuid.UUID)
func (*Config) SessionTimeout ¶
func (c *Config) SessionTimeout(w http.ResponseWriter)
func (*Config) Wrap ¶
func (c *Config) Wrap(f func(db *Config, w http.ResponseWriter, r *http.Request)) http.HandlerFunc
type Data ¶
type Data struct { TimeoutAt time.Time `json:",omitempty"` CurrentUserID string `json:",omitempty"` LastSeen time.Time `json:",omitempty"` LoggedIn bool `json:",omitempty"` Captcha string `json:",omitempty"` Csrf string `json:",omitempty"` LoginDest string `json:",omitempty"` Flash Flash `json:",omitempty"` }
type SessionContext ¶
type SessionContext struct { Data Data // contains filtered or unexported fields }
func (*SessionContext) FailFlash ¶
func (s *SessionContext) FailFlash(m string) *SessionContext
func (*SessionContext) SaveSharedLink ¶
func (s *SessionContext) SaveSharedLink(w http.ResponseWriter, name string) error
func (*SessionContext) SuccessFlash ¶
func (s *SessionContext) SuccessFlash(m string) *SessionContext
Source Files ¶
Click to show internal directories.
Click to hide internal directories.