app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SweepUploads = "coyote.uploads.sweep"
	SweepTokens  = "coyote.tokens.sweep"
)
View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*router.Router
	Settings  Settings
	Logger    *slog.Logger
	Sessions  *session.Manager
	Auth      *auth.Service
	Templates *template.Engine
	Uploads   *upload.Service
	Started   time.Time
	// contains filtered or unexported fields
}

func New

func New() *App

func NewFrom

func NewFrom(s Settings) *App

func (*App) AuthService

func (a *App) AuthService() *auth.Service

func (*App) Bundle

func (a *App) Bundle() *i18n.Bundle

func (*App) CSRF

func (a *App) CSRF(next http.Handler) http.Handler

func (*App) Cache

func (a *App) Cache() cache.Cache

func (*App) CacheByAlias

func (a *App) CacheByAlias(alias string) (cache.Cache, error)

func (*App) CacheStats

func (a *App) CacheStats() []cache.Stats

func (*App) CheckCaches

func (a *App) CheckCaches(ctx context.Context) error

func (*App) CloseDB

func (a *App) CloseDB() error

func (*App) Config

func (a *App) Config() Settings

func (*App) Context

func (a *App) Context(r *http.Request, data Data) Data

func (*App) DB

func (a *App) DB() (*gorm.DB, error)

func (*App) DBByAlias

func (a *App) DBByAlias(alias string) (*gorm.DB, error)

func (*App) DBFor

func (a *App) DBFor(entity any) (*gorm.DB, error)

func (*App) Describe

func (a *App) Describe(entity any) (*model.Schema, error)

func (*App) Handler

func (a *App) Handler() http.Handler

func (*App) Jobs

func (a *App) Jobs() *jobs.Runner

func (*App) Locale

func (a *App) Locale(r *http.Request) *i18n.Locale

func (*App) Locales

func (a *App) Locales() *i18n.Detector

func (*App) Log

func (a *App) Log() *slog.Logger

func (*App) ManageableSessions

func (a *App) ManageableSessions() (session.ManageableStore, bool)

func (*App) MediaURL

func (a *App) MediaURL(ref upload.Ref) string

func (*App) Models

func (a *App) Models() []model.Model

func (*App) PermissionResources

func (a *App) PermissionResources() ([]string, error)

func (*App) Pool

func (a *App) Pool() (*sql.DB, error)

func (*App) ProbeCaches

func (a *App) ProbeCaches(ctx context.Context) []cache.Status

func (*App) Queue

func (a *App) Queue() jobs.Queue

func (*App) RegisterModel

func (a *App) RegisterModel(models ...model.Model)

func (*App) Registry

func (a *App) Registry() *model.Registry

func (*App) Render

func (a *App) Render(w http.ResponseWriter, r *http.Request, page string, data Data)

func (*App) RenderStatus

func (a *App) RenderStatus(w http.ResponseWriter, r *http.Request, status int, page string, data Data)

func (*App) Run

func (a *App) Run() error

func (*App) Serve

func (a *App) Serve() error

func (*App) SessionStore

func (a *App) SessionStore() session.Store

func (*App) SetNotFound

func (a *App) SetNotFound(handler http.Handler)

func (*App) Static

func (a *App) Static(prefix string, fsys fs.FS)

func (*App) StaticURL

func (a *App) StaticURL(name string) string

func (*App) Store

func (a *App) Store() (model.Store, error)

func (*App) StoreFor

func (a *App) StoreFor(entity any) (model.Store, error)

func (*App) StoreForAlias

func (a *App) StoreForAlias(alias string) (model.Store, error)

func (*App) SyncPermissions

func (a *App) SyncPermissions(ctx context.Context) (auth.SyncReport, error)

func (*App) Transaction

func (a *App) Transaction(ctx context.Context, fn func(*Tx) error) error

func (*App) Use

func (a *App) Use(mw ...Middleware)

func (*App) Worker

func (a *App) Worker(workers int, queues []string) (*jobs.Runner, error)

type Data

type Data = view.Data

type Middleware

type Middleware = router.Middleware

type Route

type Route = router.Route

type Router

type Router = router.Router

type Settings

type Settings = settings.Settings

type Tx

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

func (*Tx) DB

func (t *Tx) DB() *gorm.DB

func (*Tx) Keep

func (t *Tx) Keep(refs ...*upload.Ref)

func (*Tx) Queue

func (t *Tx) Queue() jobs.Queue

func (*Tx) Store

func (t *Tx) Store() model.Store

type UnreachableCache

type UnreachableCache struct {
	Status cache.Status
	Index  int
}

func (*UnreachableCache) Error

func (e *UnreachableCache) Error() string

func (*UnreachableCache) Unwrap

func (e *UnreachableCache) Unwrap() error

Jump to

Keyboard shortcuts

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