Versions in this module Expand all Collapse all v0 v0.1.1 Oct 12, 2026 Changes in this version + var ErrNotFound = errors.New("folio: not found") v0.1.0 Oct 12, 2026 Changes in this version + const ClientPrefix + const MaxJSONBody + func DecodeJSON(w http.ResponseWriter, r *http.Request, v any) error + func JSON(w http.ResponseWriter, status int, v any) error + func SafeNext(r *http.Request, fallback string) string + func WantsJSON(r *http.Request) bool + type App struct + func New(cfg Config) (*App, error) + func (a *App) Action(route string, fn LoadFunc) + func (a *App) Group(prefix string, mw ...Middleware) + func (a *App) Handle(pattern string, h http.Handler) + func (a *App) HandleFunc(pattern string, h func(http.ResponseWriter, *http.Request)) + func (a *App) Handler() http.Handler + func (a *App) ListenAndServe(addr string) error + func (a *App) Load(route string, fn LoadFunc) + func (a *App) LoadAll(fn LoadFunc) + func (a *App) RequireLogin(cfg LoginConfig) Middleware + func (a *App) Routes() []string + func (a *App) Use(mw ...Middleware) + type Config struct + DisableCSRF bool + Funcs template.FuncMap + Globals map[string]any + Layout string + Logger *slog.Logger + MaxFormMemory int64 + Reload bool + SecretKey []byte + SessionCookie string + SessionMaxAge time.Duration + SessionStore SessionStore + Static fs.FS + StaticPrefix string + StrictTemplates bool + Templates fs.FS + TrustedOrigins []string + type Ctx struct + Logger *slog.Logger + Page map[string]any + Request *http.Request + Route string + func (c *Ctx) Done() bool + func (c *Ctx) Fail(message string, fieldErrors map[string]string) + func (c *Ctx) Flash(message string) + func (c *Ctx) Get(key string) any + func (c *Ctx) Header() http.Header + func (c *Ctx) JSON(status int, v any) error + func (c *Ctx) Param(name string) string + func (c *Ctx) Redirect(url string, code int) + func (c *Ctx) Session() *Session + func (c *Ctx) Set(key string, value any) + func (c *Ctx) SetModel(v any) + func (c *Ctx) Status(code int) + func (c *Ctx) Success(message string) + func (c *Ctx) Writer() http.ResponseWriter + type LoadFunc func(c *Ctx) error + type LoginConfig struct + LoginURL string + Public []string + SessionKey string + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (m *MemoryStore) Delete(_ context.Context, id string) error + func (m *MemoryStore) Load(_ context.Context, id string) (map[string]string, error) + func (m *MemoryStore) Save(_ context.Context, id string, values map[string]string, expires time.Time) error + type Middleware func(http.Handler) http.Handler + func Compress() Middleware + func Recoverer(logger *slog.Logger) Middleware + func RequestLogger(logger *slog.Logger) Middleware + type Session struct + func GetSession(r *http.Request) *Session + func (s *Session) Clear() + func (s *Session) Delete(key string) + func (s *Session) Get(key string) string + func (s *Session) Pop(key string) string + func (s *Session) Renew() + func (s *Session) Set(key, value string) + type SessionStore interface + Delete func(ctx context.Context, id string) error + Load func(ctx context.Context, id string) (map[string]string, error) + Save func(ctx context.Context, id string, values map[string]string, expires time.Time) error + type View struct + Dev bool + Error string + Flash string + HTML template.HTML + Model any + Page map[string]any + Params map[string]string + Path string + Route string + Shell string + Status int