Versions in this module Expand all Collapse all v0 v0.3.0 Dec 5, 2026 Changes in this version + func AuditEvent(ctx context.Context, ev audit.Event) error type Metric + func (m *Metric) Snapshot() *Metric v0.2.0 Dec 5, 2026 Changes in this version + type Asset struct + Base string + Body []byte + ContentType string + Ext string + Kind AssetKind + type AssetKind uint8 + const AssetScript + const AssetSprite + const AssetStyle type Field + func Files[T any](name string, get Getter[T, []string], u Upload) *Field[T, []string] + func Images[T any](name string, get Getter[T, []string], u Upload) *Field[T, []string] + func (f *Field[T, V]) Action(a FieldAction) *Field[T, V] + func (f *Field[T, V]) HideWhenEmpty() *Field[T, V] + func (f *Field[T, V]) Span(n int) *Field[T, V] + func (f *Field[T, V]) Widget(w Widget) *Field[T, V] + func (f *Field[T, V]) WriteOnly() *Field[T, V] + type FieldAction interface type Resource + func (r *Resource[T, ID]) Sections(ss ...*SectionDef[T]) *Resource[T, ID] + type SectionDef struct + func Section[T any](title string, fields ...FieldDef[T]) *SectionDef[T] + func (s *SectionDef[T]) Aside() *SectionDef[T] + func (s *SectionDef[T]) Columns(n int) *SectionDef[T] + func (s *SectionDef[T]) Help(text string) *SectionDef[T] type Upload + MaxFiles int + type UploadTicket struct + Headers map[string]string + Method string + Token string + URL string + type Widget interface + Assets func() []Asset + Clean func(ctx context.Context, raw string) (string, error) + Display func(ctx context.Context, v string) (crest.Component, error) + Input func(ctx context.Context, in WidgetInput) crest.Component + Text func(v string) string + WidgetKind func() string + type WidgetCSP interface + CSPSources func() map[string][]string + type WidgetEvents interface + Event func(ctx context.Context, h WidgetHost, op string, data json.RawMessage) (any, error) + type WidgetHost interface + BeginUpload func(ctx context.Context, contentType string, size int64) (UploadTicket, error) + FinishUpload func(ctx context.Context, token string) (key string, err error) + type WidgetInput struct + DescribedBy string + ID string + Invalid bool + LabelID string + MaxLen int + Name string + Placeholder string + ReadOnly bool + Required bool + Rows int + Value string + type WidgetUploads interface + ReleaseRemoved func() bool + UploadKeys func(v string) []string + WidgetUpload func() (u Upload, ok bool) v0.1.0 Dec 5, 2026 Changes in this version + var ErrConflict = errors.New("sight: the record was changed by someone else") + var ErrNoTx = errors.New("sight: the panel has no transaction runner (WithDB or WithTx)") + var ErrNotFound error = notFoundError + var MonthToDate = RangeDef + var QuarterToDate = RangeDef + var Tables = []*schema.TableDef + var Today = RangeDef + var YearToDate = RangeDef + func Actor(ctx context.Context) string + func Audit(ctx context.Context, action, resource string, meta map[string]any) error + func CSPSources(p *Panel) map[string][]string + func Change[V any](c Changes, name string) (v V, set bool, null bool) + func CountOf(q *nock.SelectQuery, at nock.Col[time.Time]) func(ctx context.Context, r Range) (ValueResult, error) + func CurrentID(c *live.Ctx) string + func CurrentRecord[T any, ID comparable](c *live.Ctx, r *Resource[T, ID]) (*T, error) + func CurrentTx(ctx context.Context) any + func DateRange(ctx context.Context, v FilterValue) (from, to time.Time) + func Exec(ctx context.Context) nock.Executor + func FieldError(name, msg string) error + func FormatCount(v int64) string + func FormatMoney(code string) func(int64) string + func FormatPercentBP(v int64) string + func ImageAuthorizer(next images.Authorizer) images.Authorizer + func ImpersonationAudit(rec audit.Recorder) func(ctx context.Context, e auth.ImpersonationEvent) error + func Mount(mux *http.ServeMux, panels ...*Panel) error + func NavOrder(n int) interface + func Notify(c *live.Ctx, tone Tone, msg string) error + func Progress(ctx context.Context, done, total int, note string) + func Require(ctx context.Context, perm rbac.Permission) error + func RunMeta(run RunInfo) []quiver.EnqueueOption + func SQLAudit(tx any) audit.Recorder + func StrictCSP() secure.Config + func SumOf(q *nock.SelectQuery, value nock.Col[int64], at nock.Col[time.Time]) func(ctx context.Context, r Range) (ValueResult, error) + func SweepUploads(ctx context.Context, p *Panel, olderThan time.Duration) (int, error) + func TrendOf(q *nock.SelectQuery, at nock.Col[time.Time], value nock.Col[int64], b Bucket) func(ctx context.Context, r Range) ([]Point, error) + func Tx(ctx context.Context, fn func(ctx context.Context, tx any) error) error + func ValueOf[V any](vals Values, name string) (V, bool) + func WatchRun(c *live.Ctx, id string, fn func(c *live.Ctx, ev RunEvent) error) error + func WidgetOf(ctx context.Context, m *Metric, rangeKey string) ui.WidgetData + type ActionBuilder struct + func Action[T any, ID comparable, In any](key, label string) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Both() *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Bulk() *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Can(perm rbac.Permission) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Confirm(title string, body ...string) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Destructive() *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Form(inputs ...*Input[In]) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) JobKind(kind string) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Queue(...) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Row() *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Run(fn func(ctx context.Context, rows []*T, in In, run RunInfo) (Result, error)) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Timeout(d time.Duration) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Transactional() *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) Validate(fn func(ctx context.Context, rows []*T, in *In) error) *ActionBuilder[T, ID, In] + func (a *ActionBuilder[T, ID, In]) When(fn func(ctx context.Context, row *T) bool) *ActionBuilder[T, ID, In] + type ActionDef interface + type BadgeValue struct + Text string + Tone Tone + type Brand struct + Favicon string + HomeURL string + Logo crest.Component + LogoURL string + Name string + type Bucket string + const Day + const Month + const Week + type CanOption struct + func Can(perm rbac.Permission) CanOption + type Changes struct + func (c *Changes) Assign(as ...nock.Assignment) + func (c Changes) Assignments() []nock.Assignment + func (c Changes) Has(name string) bool + func (c Changes) Len() int + func (c Changes) Names() []string + type Column struct + Cell func(*T) string + Label string + Link func(*T) string + Numeric bool + type Density string + const Comfortable + const Compact + type Field struct + func Badge[T any](name string, fn func(*T) (string, Tone)) *Field[T, string] + func BelongsTo[T any, R any, RID comparable](name string, get Getter[T, RID], target *Resource[R, RID]) *Field[T, RID] + func Boolean[T any](name string, get Getter[T, bool]) *Field[T, bool] + func DateTime[T any](name string, get Getter[T, time.Time]) *Field[T, time.Time] + func Date[T any](name string, get Getter[T, time.Time]) *Field[T, time.Time] + func File[T any](name string, get Getter[T, string], u Upload) *Field[T, string] + func Image[T any](name string, get Getter[T, string], u Upload) *Field[T, string] + func JSON[T any](name string, get Getter[T, []byte]) *Field[T, []byte] + func KeyValue[T any](name string, get Getter[T, []byte]) *Field[T, []byte] + func Markdown[T any](name string, get Getter[T, string]) *Field[T, string] + func Money[T any](name string, get Getter[T, int64], currency string) *Field[T, int64] + func MultiSelect[T any](name string, get Getter[T, []string], opts ...Option) *Field[T, []string] + func Number[T any, N Numeric](name string, get Getter[T, N]) *Field[T, N] + func Select[T any](name string, get Getter[T, string], opts ...Option) *Field[T, string] + func Status[T any](name string, get Getter[T, string], opts ...Option) *Field[T, string] + func Tags[T any](name string, get Getter[T, []string]) *Field[T, []string] + func Text[T any](name string, get Getter[T, string]) *Field[T, string] + func Textarea[T any](name string, get Getter[T, string]) *Field[T, string] + func Toggle[T any](name string, get Getter[T, bool]) *Field[T, bool] + func (f *Field[T, V]) AuditValues() *Field[T, V] + func (f *Field[T, V]) Can(perm rbac.Permission) *Field[T, V] + func (f *Field[T, V]) CanEdit(perm rbac.Permission) *Field[T, V] + func (f *Field[T, V]) Col(c nock.Col[V]) *Field[T, V] + func (f *Field[T, V]) ColJSON(c nock.Col[[]byte]) *Field[T, V] + func (f *Field[T, V]) CreateOnly() *Field[T, V] + func (f *Field[T, V]) CurrencyFrom(fn func(*T) string) *Field[T, V] + func (f *Field[T, V]) DefaultFunc(fn func(ctx context.Context, vals Values) V) *Field[T, V] + func (f *Field[T, V]) DependsOn(names ...string) *Field[T, V] + func (f *Field[T, V]) Editable() *Field[T, V] + func (f *Field[T, V]) Email() *Field[T, V] + func (f *Field[T, V]) ExceptOnForms() *Field[T, V] + func (f *Field[T, V]) Format(fn func(V) string) *Field[T, V] + func (f *Field[T, V]) Help(s string) *Field[T, V] + func (f *Field[T, V]) HideFromDetail() *Field[T, V] + func (f *Field[T, V]) HideFromIndex() *Field[T, V] + func (f *Field[T, V]) Label(s string) *Field[T, V] + func (f *Field[T, V]) Link(fn func(row *T) string) *Field[T, V] + func (f *Field[T, V]) Max(v V) *Field[T, V] + func (f *Field[T, V]) MaxLen(n int) *Field[T, V] + func (f *Field[T, V]) Min(v V) *Field[T, V] + func (f *Field[T, V]) MinLen(n int) *Field[T, V] + func (f *Field[T, V]) Nullable() *Field[T, V] + func (f *Field[T, V]) OnlyOnDetail() *Field[T, V] + func (f *Field[T, V]) OnlyOnForms() *Field[T, V] + func (f *Field[T, V]) OnlyOnIndex() *Field[T, V] + func (f *Field[T, V]) OptionsFunc(fn func(ctx context.Context, vals Values) ([]Option, error)) *Field[T, V] + func (f *Field[T, V]) Pattern(re string) *Field[T, V] + func (f *Field[T, V]) Placeholder(s string) *Field[T, V] + func (f *Field[T, V]) ReadOnly() *Field[T, V] + func (f *Field[T, V]) ReadOnlyWhen(fn func(ctx context.Context, row *T) bool) *Field[T, V] + func (f *Field[T, V]) Required() *Field[T, V] + func (f *Field[T, V]) Rows(n int) *Field[T, V] + func (f *Field[T, V]) Searchable() *Field[T, V] + func (f *Field[T, V]) Sensitive() *Field[T, V] + func (f *Field[T, V]) Sortable() *Field[T, V] + func (f *Field[T, V]) Step(s string) *Field[T, V] + func (f *Field[T, V]) Suffix(s string) *Field[T, V] + func (f *Field[T, V]) URL() *Field[T, V] + func (f *Field[T, V]) Unique() *Field[T, V] + func (f *Field[T, V]) Validate(fn func(ctx context.Context, v V, vals Values) error) *Field[T, V] + func (f *Field[T, V]) VisibleWhen(fn func(ctx context.Context, vals Values) bool) *Field[T, V] + type FieldDef interface + type FieldErrors struct + func (e *FieldErrors) Add(name, msg string) + func (e *FieldErrors) Error() string + func (e *FieldErrors) Fields() map[string]string + func (e *FieldErrors) Get(name string) string + func (e *FieldErrors) Len() int + type Filter interface + func FilterBelongsTo[RID comparable, R any](col nock.Col[RID], label string, target *Resource[R, RID]) Filter + func FilterBool(col nock.Col[bool], label string) Filter + func FilterCustom(key, label string, input FilterInput, ...) Filter + func FilterDateRange(key, label string) Filter + func FilterDateRangeOn(col nock.Col[time.Time], label string) Filter + func FilterIn[V comparable](col nock.Col[V], label string, opts ...Option) Filter + func FilterNumberRange[N Numeric](col nock.Col[N], label string) Filter + type FilterInput string + const FilterInputBool + const FilterInputDates + const FilterInputNumber + const FilterInputSelect + const FilterInputText + type FilterValue struct + Key string + Op string + Values []string + type Getter func(*T) (V, bool) + func GetNull[T, V any](fn func(*T) *V) Getter[T, V] + func Get[T, V any](fn func(*T) V) Getter[T, V] + type Host = interface + AlpineBundle func() *alpine.Bundle + AuditRecorder func() audit.Recorder + Authenticator func() auth.Authenticator + Broker func() pubsub.Broker + ImageService func() images.Service + NockDB func() nock.DB + Queue func() quiver.Queue + Store func() storage.Store + type Input struct + func InBelongsTo[In any, R any, RID comparable](name string, ptr func(*In) *RID, target *Resource[R, RID]) *Input[In] + func InDate[In any](name string, ptr func(*In) *time.Time) *Input[In] + func InMoney[In any](name string, ptr func(*In) *int64, currency string) *Input[In] + func InNumber[In any, N Numeric](name string, ptr func(*In) *N) *Input[In] + func InSelect[In any](name string, ptr func(*In) *string, opts ...Option) *Input[In] + func InText[In any](name string, ptr func(*In) *string) *Input[In] + func InTextarea[In any](name string, ptr func(*In) *string) *Input[In] + func InToggle[In any](name string, ptr func(*In) *bool) *Input[In] + func (in *Input[In]) AuditValue() *Input[In] + func (in *Input[In]) Default(raw string) *Input[In] + func (in *Input[In]) Help(s string) *Input[In] + func (in *Input[In]) Label(s string) *Input[In] + func (in *Input[In]) Max(v float64) *Input[In] + func (in *Input[In]) MaxLen(n int) *Input[In] + func (in *Input[In]) Min(v float64) *Input[In] + func (in *Input[In]) Required() *Input[In] + func (in *Input[In]) Validate(fn func(ctx context.Context, x *In) error) *Input[In] + type Installer struct + func (in *Installer) Dashboard(ms ...*Metric) + func (in *Installer) Nav(groups ...NavGroup) + func (in *Installer) Register(items ...Registrable) error + func (in *Installer) Stylesheet(href string) + type LensDef struct + func Lens(key, label string, parts ...LensPart) LensDef + type LensPart interface + func Columns(names ...string) LensPart + func FilterPreset(key string, values ...string) LensPart + func SortBy(spec string) LensPart + func Where(exprs ...nock.Expr) LensPart + type ListQuery struct + Filters []FilterValue + Lens string + Page int + Parent *ParentRef + PerPage int + Search string + Sort []SortKey + Trash nock.TrashScope + Where []nock.Expr + func (q ListQuery) Offset() int + type Metric struct + func PartitionMetric(key, label string, fn func(ctx context.Context, r Range) ([]Slice, error)) *Metric + func TableWidget[T any](key, label string, fn func(ctx context.Context) ([]T, error), ...) *Metric + func TrendMetric(key, label string, fn func(ctx context.Context, r Range) ([]Point, error)) *Metric + func ValueMetric(key, label string, fn func(ctx context.Context, r Range) (ValueResult, error)) *Metric + func (m *Metric) Bars() *Metric + func (m *Metric) Bucket(b Bucket) *Metric + func (m *Metric) Can(perm rbac.Permission) *Metric + func (m *Metric) Donut() *Metric + func (m *Metric) Format(fn func(int64) string) *Metric + func (m *Metric) Help(s string) *Metric + func (m *Metric) Key() string + func (m *Metric) Line() *Metric + func (m *Metric) Link(url string, label ...string) *Metric + func (m *Metric) LowerIsBetter() *Metric + func (m *Metric) Ranges(defs ...RangeDef) *Metric + func (m *Metric) Refresh(d time.Duration) *Metric + func (m *Metric) Stacked() *Metric + func (m *Metric) Width(n int) *Metric + type NavGroup struct + func Group(label, icon string, opts ...NavOption) NavGroup + type NavItemOption interface + func Hidden() NavItemOption + func Icon(name string) NavItemOption + func InGroup(label string) NavItemOption + func NavBadge(fn func(ctx context.Context) (BadgeValue, error)) NavItemOption + type NavOption interface + type NockOption interface + func AfterWrite[ID comparable](fn func(ctx context.Context, tx any, id ID, ch Changes) error) NockOption + func BaseQuery(fn func(ctx context.Context) *nock.SelectQuery) NockOption + func BeforeWrite[ID comparable](fn func(ctx context.Context, tx any, id *ID, ch *Changes) error) NockOption + func Scope(fn func(ctx context.Context) (nock.Expr, error)) NockOption + func SoftDelete(col nock.Col[time.Time]) NockOption + func Unscoped() NockOption + func Version(col nock.Col[time.Time]) NockOption + type NockRepository struct + func NockRepo[T any, ID comparable](table nock.TableRef, pk nock.Col[ID], opts ...NockOption) *NockRepository[T, ID] + func (r *NockRepository[T, ID]) Create(ctx context.Context, ch Changes) (ID, error) + func (r *NockRepository[T, ID]) Delete(ctx context.Context, id ID) error + func (r *NockRepository[T, ID]) Find(ctx context.Context, id ID) (T, error) + func (r *NockRepository[T, ID]) FindTrashed(ctx context.Context, id ID) (T, error) + func (r *NockRepository[T, ID]) ForceDelete(ctx context.Context, id ID) error + func (r *NockRepository[T, ID]) List(ctx context.Context, q ListQuery) (Page[T], error) + func (r *NockRepository[T, ID]) Restore(ctx context.Context, id ID) error + func (r *NockRepository[T, ID]) Trashed(ctx context.Context, ids []ID) (map[ID]bool, error) + func (r *NockRepository[T, ID]) Update(ctx context.Context, id ID, ch Changes) error + type Numeric interface + type Option struct + Label string + Value string + func Opt(value, label string) Option + func (o Option) Disabled() Option + func (o Option) Tone(t Tone) Option + type OptionItem struct + ID string + Subtitle string + Title string + type Optioner interface + Options func(ctx context.Context, term string, limit int) ([]OptionItem, error) + type Page struct + Items []T + func NewPage[T any](items []T, q ListQuery, total int64) Page[T] + type PageDef struct + func CustomPage(slug, title string, newView func() live.Component, opts ...PageOption) *PageDef + type PageOption interface + type Panel struct + func New(id string, opts ...PanelOption) *Panel + func (p *Panel) Adopt(h Host) error + func (p *Panel) DashboardEvent(c *live.Ctx, v *views.DashboardPage, name string, payload json.RawMessage) error + func (p *Panel) DetailEvent(c *live.Ctx, v *views.DetailPage, name string, payload json.RawMessage) error + func (p *Panel) FormEvent(c *live.Ctx, v *views.FormPage, name string, payload json.RawMessage) error + func (p *Panel) Handler() http.Handler + func (p *Panel) ID() string + func (p *Panel) ImpersonationExitPath() string + func (p *Panel) IndexEvent(c *live.Ctx, v *views.IndexPage, name string, payload json.RawMessage) error + func (p *Panel) InspectJSON() ([]byte, error) + func (p *Panel) LiveHandlers() []*live.Handler + func (p *Panel) Mount(r *router.Router) + func (p *Panel) MountDashboard(c *live.Ctx, v *views.DashboardPage) error + func (p *Panel) MountDetail(c *live.Ctx, v *views.DetailPage) error + func (p *Panel) MountForm(c *live.Ctx, v *views.FormPage) error + func (p *Panel) MountIndex(c *live.Ctx, v *views.IndexPage) error + func (p *Panel) MountPalette(c *live.Ctx, v *views.Palette) error + func (p *Panel) MountPrefixes() []string + func (p *Panel) PaletteEvent(c *live.Ctx, v *views.Palette, name string, payload json.RawMessage) error + func (p *Panel) Path() string + func (p *Panel) Permissions() []rbac.Permission + func (p *Panel) Plugins() []string + func (p *Panel) Register(items ...Registrable) error + func (p *Panel) Routes() []Route + func (p *Panel) RunMiddleware() quiver.Middleware + func (p *Panel) State() StateStore + func (p *Panel) Use(ps ...Plugin) error + type PanelOption func(*Panel) + func WithAccess(perm rbac.Permission) PanelOption + func WithAlpine(b *alpine.Bundle) PanelOption + func WithAudit(r audit.Recorder) PanelOption + func WithAuth(a auth.Authenticator) PanelOption + func WithBrand(b Brand) PanelOption + func WithBroker(b pubsub.Broker) PanelOption + func WithBulkLimit(n int) PanelOption + func WithCSRFSecret(secret []byte) PanelOption + func WithCSRFToken(fn func(*http.Request) string) PanelOption + func WithClock(now func() time.Time) PanelOption + func WithDB(db nock.DB) PanelOption + func WithDashboard(ms ...*Metric) PanelOption + func WithExportLimit(n int) PanelOption + func WithIcons(fsys fs.FS) PanelOption + func WithImages(s images.Service) PanelOption + func WithImpersonation(im *auth.Impersonation) PanelOption + func WithLiveOptions(opts ...live.Option) PanelOption + func WithLoginURL(url string) PanelOption + func WithMarkdown(fn func(ctx context.Context, src string) (crest.Component, error)) PanelOption + func WithMoneyFormat(fn func(minor int64, code string) string) PanelOption + func WithNav(groups ...NavGroup) PanelOption + func WithPath(prefix string) PanelOption + func WithPlugins(ps ...Plugin) PanelOption + func WithPolicy(pol *rbac.Policy) PanelOption + func WithQueue(q quiver.Queue) PanelOption + func WithSecureHeaders(on bool) PanelOption + func WithState(s StateStore) PanelOption + func WithStorage(s storage.Store) PanelOption + func WithSubject(fn func(ctx context.Context, userID string) (rbac.Subject, error)) PanelOption + func WithSubjectTTL(d time.Duration) PanelOption + func WithTheme(t Theme) PanelOption + func WithTimeZone(loc *time.Location) PanelOption + func WithTx(fn func(ctx context.Context, fn func(ctx context.Context, tx any) error) error) PanelOption + func WithTxAudit(fn func(tx any) audit.Recorder) PanelOption + func WithUploadKey(key []byte) PanelOption + type ParentRef struct + ID any + Relation string + type Pivot struct + Parent nock.Col[ID] + Related nock.Col[RID] + Table nock.TableRef + type Plugin interface + Install func(in *Installer) error + PluginID func() string + type Point struct + At time.Time + Value int64 + type Range struct + From time.Time + Key string + To time.Time + func (r Range) Previous() Range + type RangeDef struct + Compare string + Key string + Label string + func Days(n int) RangeDef + func (d RangeDef) Resolve(now time.Time) Range + type RecordPageDef struct + func RecordPage[T any, ID comparable](slug, title string, newView func() live.Component, opts ...PageOption) *RecordPageDef[T, ID] + type Registrable interface + type RelationDef struct + func BelongsToMany[ID comparable, R any, RID comparable](name string, target *Resource[R, RID], pivot Pivot[ID, RID]) *RelationDef[ID] + func HasManyVia[ID comparable, C any, CID comparable](name string, child *Resource[C, CID]) *RelationDef[ID] + func HasMany[ID comparable, C any, CID comparable](name string, child *Resource[C, CID], fk nock.Col[ID]) *RelationDef[ID] + func (r *RelationDef[ID]) Can(perm rbac.Permission) *RelationDef[ID] + func (r *RelationDef[ID]) Columns(names ...string) *RelationDef[ID] + func (r *RelationDef[ID]) Inline() *RelationDef[ID] + func (r *RelationDef[ID]) Label(s string) *RelationDef[ID] + func (r *RelationDef[ID]) PerPage(n int) *RelationDef[ID] + type Repository interface + Find func(ctx context.Context, id ID) (T, error) + List func(ctx context.Context, q ListQuery) (Page[T], error) + type Resource struct + func NewResource[T any, ID comparable](slug string, repo Repository[T, ID], opts ...ResourceOption) *Resource[T, ID] + func (r *Resource[T, ID]) Actions(as ...ActionDef[T, ID]) *Resource[T, ID] + func (r *Resource[T, ID]) Cards(ms ...*Metric) *Resource[T, ID] + func (r *Resource[T, ID]) Fields(fs ...FieldDef[T]) *Resource[T, ID] + func (r *Resource[T, ID]) Filters(fs ...Filter) *Resource[T, ID] + func (r *Resource[T, ID]) Key(fn func(*T) ID) *Resource[T, ID] + func (r *Resource[T, ID]) Lenses(ls ...LensDef) *Resource[T, ID] + func (r *Resource[T, ID]) Pages(ps ...*RecordPageDef[T, ID]) *Resource[T, ID] + func (r *Resource[T, ID]) Relations(rs ...*RelationDef[ID]) *Resource[T, ID] + func (r *Resource[T, ID]) Subtitle(fn func(*T) string) *Resource[T, ID] + func (r *Resource[T, ID]) Title(fn func(*T) string) *Resource[T, ID] + type ResourceOption interface + func DefaultSort(key string, desc bool) ResourceOption + func GlobalSearch(n int) ResourceOption + func IDCodec(parse func(string) (any, error), format func(any) string) ResourceOption + func Kind(kind string) ResourceOption + func Labels(singular, plural string) ResourceOption + func PerPage(n int, choices ...int) ResourceOption + func RequireTxAudit() ResourceOption + func WithSoftDeletes() ResourceOption + type Result interface + func Redirect(url string) Result + func Refresh() Result + func Toast(msg string) Result + func Toastf(format string, args ...any) Result + type Route struct + Handler http.Handler + Prefix string + type RunEvent struct + Done int + Error string + ID string + Note string + Result string + State RunState + Total int + type RunInfo struct + ID string + func Enqueue[A quiver.JobArgs](ctx context.Context, label string, args A, opts ...quiver.EnqueueOption) (RunInfo, error) + func RunFrom(ctx context.Context) (RunInfo, bool) + type RunProgress struct + Done int + Note string + Total int + type RunRecord struct + Action string + CreatedAt time.Time + Error string + ID string + Panel string + Resource string + Result string + State RunState + Subject string + UpdatedAt time.Time + type RunState string + const RunFailed + const RunQueued + const RunRetrying + const RunRunning + const RunSucceeded + type RunUpdate struct + Error string + Progress *RunProgress + Result string + State RunState + type SavedView struct + Columns []string + CreatedAt time.Time + ID string + Name string + Panel string + Query string + Resource string + Shared bool + Subject string + type SelectFilter struct + func FilterSelect(key, label string, opts ...Option) *SelectFilter + func (f *SelectFilter) Multiple() *SelectFilter + type Slice struct + Label string + Tone Tone + Value int64 + type SoftDeletable interface + FindTrashed func(ctx context.Context, id ID) (T, error) + ForceDelete func(ctx context.Context, id ID) error + Restore func(ctx context.Context, id ID) error + Trashed func(ctx context.Context, ids []ID) (map[ID]bool, error) + type SortKey struct + Desc bool + Key string + type StateStore interface + BeginRun func(ctx context.Context, r RunRecord) (RunRecord, bool, error) + Columns func(ctx context.Context, panel, resource, subject string) ([]string, error) + DeleteView func(ctx context.Context, id string) error + Run func(ctx context.Context, id string) (RunRecord, error) + SaveView func(ctx context.Context, v SavedView) error + SavedViews func(ctx context.Context, panel, resource, subject string) ([]SavedView, error) + SetColumns func(ctx context.Context, panel, resource, subject string, cols []string) error + UpdateRun func(ctx context.Context, id string, u RunUpdate) error + Uploads func() UploadLedger + func MemoryState() StateStore + func NockState(db nock.DB) StateStore + type Streamer interface + Each func(ctx context.Context, q ListQuery, fn func(*T) error) error + type Theme struct + Accent string + AccentDark string + Density Density + Mode ThemeMode + Stylesheets []string + Tokens map[string]string + type ThemeMode string + const ThemeDark + const ThemeLight + const ThemeSystem + type Tone string + const Danger + const Info + const Neutral + const Success + const Warning + type Upload struct + Accept []string + MaxBytes int64 + Prefix string + Preset string + Visibility storage.Visibility + type UploadLedger interface + Begin func(ctx context.Context, u UploadRecord) error + Commit func(ctx context.Context, key string) error + Forget func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) (UploadRecord, error) + Release func(ctx context.Context, key string) error + Sweep func(ctx context.Context, before time.Time) ([]UploadRecord, error) + type UploadRecord struct + Committed bool + ContentType string + CreatedAt time.Time + Field string + Key string + Panel string + Resource string + Size int64 + Subject string + type ValueResult struct + Current int64 + Previous int64 + type Values struct + type Writer interface + Create func(ctx context.Context, ch Changes) (ID, error) + Delete func(ctx context.Context, id ID) error + Update func(ctx context.Context, id ID, ch Changes) error