Versions in this module Expand all Collapse all v0 v0.2.1 Nov 16, 2026 v0.2.0 Nov 15, 2026 v0.1.1 Nov 14, 2026 v0.1.0 Nov 14, 2026 Changes in this version + const ActivityExportFailed + const ActivityExportFinished + const ActivityExportStarted + const ActivityFileRead + const ActivityFilesCleaned + const ActivityImportFailed + const ActivityImportFinished + const ActivityImportStarted + const ActivityLogName + const ActivityRefType + const CleanAction + const DefaultCleanSpec + const DefaultExportRows + const DefaultLocale + const DefaultLocation + const DefaultMaxFileBytes + const DefaultMaxRows + const DefaultPageSize + const DefaultPrefix + const DefaultProgressEvery + const DefaultQueue + const DefaultRetentionDays + const ExportJob + const FallbackLocale + const FormatCSV + const FormatXLSX + const ImportJob + const KindExport + const KindImport + const MaxFileBytesLimit + const MaxPageSize + const MaxRetentionDays + const MaxRowsLimit + const PublishCommand + const TranslationGroup + const ViewIndex + const ViewShow + const ViewState + var DefaultPaths = Paths + var ErrNotFound = fmt.Errorf("imports: run not found: %w", model.ErrModelNotFound) + var PortuguesePaths = Paths + var Statuses = []Status + func AcceptedExtensions() []string + func Itoa(n int) string + func Lines(locale string) translation.Lines + func Locales() []string + func PublishedPaths() []string + func Refuse(reason string) error + func StatusVariant(s Status) string + func ViewNames() []string + func ViewOf(a security.Action) security.Action + func ViewPackages() []string + type Change struct + Definition string + Kind string + Processed int64 + Run string + Status string + Tenant string + Total int64 + type ChromeRequest struct + Subject security.Subject + Title string + type Column struct + Example string + Headers []string + Hint string + Key string + Label string + Required bool + type ColumnView struct + Hint string + Label string + Mark string + Required bool + type Config struct + Activity *activitylog.Logger + Chrome func(ctx *fhttp.Context, req ChromeRequest) (any, error) + CleanSpec string + Definitions []Definition + Files *filesystem.Disk + Locale string + Location *time.Location + Logger *slog.Logger + MaxFileBytes int64 + Middleware []func(http.Handler) http.Handler + Now func() time.Time + OnChange func(ctx context.Context, change Change) + PageSize int + Paths Paths + Prefix string + ProgressEvery int + Queue queue.Queue + QueueName string + RetentionDays int + Scope func(ctx *fhttp.Context, who security.Subject) (security.Subject, error) + TitleSeparator string + Translator *translation.Translator + func (c Config) Validate() error + type Definition struct + Columns []Column + Description string + Examples []Row + Export *Export + ExportAction security.Action + Finish func(ctx context.Context, g security.Grant, s Summary) error + ImportAction security.Action + Key string + Label string + ListURL string + MaxRows int + Validate func(ctx context.Context, g security.Grant, row Row) (Row, error) + Write func(ctx context.Context, g security.Grant, row Row) (Outcome, error) + func (d Definition) CanExport() bool + func (d Definition) CanImport() bool + type DefinitionView struct + CanExport bool + CanImport bool + Description string + Key string + Label string + ListURL string + URL string + type Download struct + Body io.ReadCloser + ContentType string + Name string + Size int64 + type Export struct + Columns []Column + Each func(ctx context.Context, g security.Grant, emit func(Row) error) error + MaxRows int + type FormState struct + func (f FormState) ErrorSummary() []string + func (f FormState) FieldError(name string) string + func (f FormState) FieldErrors(name string) []string + func (f FormState) HasErrors() bool + func (f FormState) LogValue() slog.Value + func (f FormState) MarshalJSON() ([]byte, error) + type IndexPageData struct + Accept string + CanExport bool + CanImport bool + Columns []ColumnView + CurrentPage int + Definition *DefinitionView + Definitions []DefinitionView + ExportURL string + MaxMB string + MaxRows int + Pager components.Paginator + Pages int + PerPage int + Query string + Retention int + Rows []RunRow + SortDir string + SortKey string + StatusOptions []components.SelectOption + Statuses []string + TemplateCSV string + TemplateXLSX string + Total int + URL string + UploadURL string + func (d IndexPageData) BackLabel() string + func (d IndexPageData) BackURL() string + func (d IndexPageData) ExportLead() string + func (d IndexPageData) Overview() bool + func (d IndexPageData) TableState() components.DataTableState + func (d IndexPageData) UploadHint() string + type Labels struct + Locale string + func (l Labels) F(key string, pairs ...any) string + func (l Labels) FailureText(code string) string + func (l Labels) Field(name string) string + func (l Labels) Kind(kind string) string + func (l Labels) Status(s Status) string + func (l Labels) Summary(errs validation.Errors) []string + func (l Labels) T(key string) string + type Line struct + Number int + Reason string + Values Row + type LineRow struct + Cells []string + Number int + Reason string + type ListQuery struct + Definition string + Dir string + Page int + PerPage int + Search string + Sort string + Statuses []Status + type MappedColumn struct + Heading string + Key string + Label string + Required bool + type MappedRow struct + Found bool + Heading string + Label string + Required bool + type Module struct + func New(cfg Config, db *data.DB, sessions *security.SessionStore) (*Module, error) + func (m *Module) Boot(context.Context) error + func (m *Module) Clean(ctx context.Context) error + func (m *Module) Labels() Labels + func (m *Module) Migrations() []foundation.Migration + func (m *Module) Name() string + func (m *Module) Publishes() []foundation.Publication + func (m *Module) RegisterJobHandlers(worker *queue.Worker) error + func (m *Module) Routes(r *fhttp.Router) + func (m *Module) Schedule() []foundation.Task + func (m *Module) Service() *Service + func (m *Module) URLs() URLs + type Outcome int + const Created + const Unchanged + const Updated + type Page struct + Page int + Pages int + Rows []*Run + Total int + type Paths struct + Confirm string + Discard string + Export string + File string + Progress string + Refused string + Runs string + Template string + type Preview struct + Columns []MappedColumn + Header bool + Ignored []string + Invalid int + Problems []Line + Sample []Line + Total int + Valid int + type Refusal struct + Reason string + func (r *Refusal) Error() string + type Resource struct + func NewResource(r Run) Resource + func (r Resource) ToArray() map[string]any + func (r Resource) With() map[string]any + type Row map[string]string + type Run struct + ActorID string + Created int64 + CreatedAt time.Time + Definition string + ExpiresAt time.Time + Failure string + FileKey string + FileName string + FileSize int64 + FinishedAt *time.Time + Format string + ID string + Kind string + Preview string + Processed int64 + Refused int64 + ReportKey string + Sample string + StartedAt *time.Time + Status string + TenantID string + Total int64 + Unchanged int64 + Updated int64 + UpdatedAt time.Time + func (r Run) CanConfirm() bool + func (r Run) CanDiscard() bool + func (r Run) Current() Status + func (r Run) Finished() bool + func (r Run) HasFile() bool + func (r Run) HasReport() bool + func (r Run) IsExport() bool + func (r Run) IsImport() bool + func (r Run) Percent() int + func (row *Run) Fresh(ctx context.Context, g auth.Grant, with ...string) (*Run, error) + func (row *Run) Replicate(except ...string) (*Run, error) + type RunCollection []*Run + func RunCollectionOf(rows model.Rows) RunCollection + func (c RunCollection) Contains(key any) bool + func (c RunCollection) Except(keys ...any) RunCollection + func (c RunCollection) Find(key any) *Run + func (c RunCollection) FindOrFail(key any) (*Run, error) + func (c RunCollection) Fresh(ctx context.Context, g auth.Grant, with ...string) (RunCollection, error) + func (c RunCollection) Load(ctx context.Context, g auth.Grant, relations ...string) error + func (c RunCollection) LoadCount(ctx context.Context, g auth.Grant, relations ...string) error + func (c RunCollection) LoadMissing(ctx context.Context, g auth.Grant, relations ...string) error + func (c RunCollection) ModelKeys() []any + func (c RunCollection) Only(keys ...any) RunCollection + func (c RunCollection) Pluck(column string) []any + func (c RunCollection) Rows() model.Rows + func (c RunCollection) ToArray() []map[string]any + func (c RunCollection) Unique() RunCollection + type RunPolicy struct + func NewRunPolicy(defs []Definition) RunPolicy + func (RunPolicy) Writes(a security.Action) bool + func (p RunPolicy) Can(_ context.Context, s security.Subject, a security.Action, record Run) error + type RunQuery struct + func Runs(db model.DB) *RunQuery + func (q *RunQuery) AddSelect(columns ...any) *RunQuery + func (q *RunQuery) Avg(ctx context.Context, g auth.Grant, column any) (any, error) + func (q *RunQuery) Base() *model.Builder + func (q *RunQuery) Chunk(ctx context.Context, g auth.Grant, count int, ...) error + func (q *RunQuery) Clone() *RunQuery + func (q *RunQuery) Count(ctx context.Context, g auth.Grant, columns ...any) (int64, error) + func (q *RunQuery) Create(ctx context.Context, g auth.Grant, attributes map[string]any) (*Run, error) + func (q *RunQuery) Cursor(ctx context.Context, g auth.Grant) iter.Seq2[*Run, error] + func (q *RunQuery) CursorPaginate(ctx context.Context, g auth.Grant, perPage int, cursor *pagination.Cursor, ...) (RunCollection, *pagination.CursorPage, error) + func (q *RunQuery) Decrement(ctx context.Context, g auth.Grant, column string, amount any, ...) (int64, error) + func (q *RunQuery) Delete(ctx context.Context, g auth.Grant) (int64, error) + func (q *RunQuery) DoesntExist(ctx context.Context, g auth.Grant) (bool, error) + func (q *RunQuery) DoesntHave(relation, boolean string, callback func(*query.Builder)) *RunQuery + func (q *RunQuery) Each(ctx context.Context, g auth.Grant, count int, ...) error + func (q *RunQuery) Exists(ctx context.Context, g auth.Grant) (bool, error) + func (q *RunQuery) Find(ctx context.Context, g auth.Grant, id any, columns ...any) (*Run, error) + func (q *RunQuery) FindMany(ctx context.Context, g auth.Grant, ids []any, columns ...any) (RunCollection, error) + func (q *RunQuery) FindOrFail(ctx context.Context, g auth.Grant, id any, columns ...any) (*Run, error) + func (q *RunQuery) FindOrNew(ctx context.Context, g auth.Grant, id any, columns ...any) (*Run, error) + func (q *RunQuery) First(ctx context.Context, g auth.Grant, columns ...any) (*Run, error) + func (q *RunQuery) FirstOrCreate(ctx context.Context, g auth.Grant, attributes, values map[string]any) (*Run, error) + func (q *RunQuery) FirstOrFail(ctx context.Context, g auth.Grant, columns ...any) (*Run, error) + func (q *RunQuery) FirstOrNew(ctx context.Context, g auth.Grant, attributes, values map[string]any) (*Run, error) + func (q *RunQuery) FirstWhere(ctx context.Context, g auth.Grant, column any, args ...any) (*Run, error) + func (q *RunQuery) ForPage(page, perPage int) *RunQuery + func (q *RunQuery) ForceCreate(ctx context.Context, g auth.Grant, attributes map[string]any) (*Run, error) + func (q *RunQuery) Get(ctx context.Context, g auth.Grant, columns ...any) (RunCollection, error) + func (q *RunQuery) GroupBy(groups ...any) *RunQuery + func (q *RunQuery) Has(relation, operator string, count int, boolean string, ...) *RunQuery + func (q *RunQuery) Increment(ctx context.Context, g auth.Grant, column string, amount any, ...) (int64, error) + func (q *RunQuery) Insert(ctx context.Context, g auth.Grant, values ...map[string]any) (bool, error) + func (q *RunQuery) InsertOrIgnore(ctx context.Context, g auth.Grant, values ...map[string]any) (bool, error) + func (q *RunQuery) Join(table any, first any, args ...any) *RunQuery + func (q *RunQuery) Latest(column ...string) *RunQuery + func (q *RunQuery) Limit(value int) *RunQuery + func (q *RunQuery) Max(ctx context.Context, g auth.Grant, column any) (any, error) + func (q *RunQuery) Min(ctx context.Context, g auth.Grant, column any) (any, error) + func (q *RunQuery) New() (*Run, error) + func (q *RunQuery) Offset(value int) *RunQuery + func (q *RunQuery) Oldest(column ...string) *RunQuery + func (q *RunQuery) OrDoesntHave(relation string) *RunQuery + func (q *RunQuery) OrHas(relation, operator string, count int) *RunQuery + func (q *RunQuery) OrWhere(column any, args ...any) *RunQuery + func (q *RunQuery) OrWhereDoesntHave(relation string, callback func(*query.Builder)) *RunQuery + func (q *RunQuery) OrWhereHas(relation string, callback func(*query.Builder)) *RunQuery + func (q *RunQuery) OrWhereNot(column any, args ...any) *RunQuery + func (q *RunQuery) OrWhereRelation(relation string, column any, args ...any) *RunQuery + func (q *RunQuery) OrderBy(column any, direction ...string) *RunQuery + func (q *RunQuery) OrderByDesc(column any) *RunQuery + func (q *RunQuery) Paginate(ctx context.Context, g auth.Grant, perPage, page int, opts pagination.Options, ...) (RunCollection, *pagination.LengthAwarePage, error) + func (q *RunQuery) Pluck(ctx context.Context, g auth.Grant, column string) ([]any, error) + func (q *RunQuery) Select(columns ...any) *RunQuery + func (q *RunQuery) SelectRaw(expression string, bindings ...any) *RunQuery + func (q *RunQuery) SimplePaginate(ctx context.Context, g auth.Grant, perPage, page int, opts pagination.Options, ...) (RunCollection, *pagination.Page, error) + func (q *RunQuery) Sole(ctx context.Context, g auth.Grant, columns ...any) (*Run, error) + func (q *RunQuery) SoleValue(ctx context.Context, g auth.Grant, column string) (any, error) + func (q *RunQuery) Sum(ctx context.Context, g auth.Grant, column any) (any, error) + func (q *RunQuery) Touch(ctx context.Context, g auth.Grant, column ...string) (int64, error) + func (q *RunQuery) Update(ctx context.Context, g auth.Grant, values map[string]any) (int64, error) + func (q *RunQuery) UpdateOrCreate(ctx context.Context, g auth.Grant, attributes, values map[string]any) (*Run, error) + func (q *RunQuery) Upsert(ctx context.Context, g auth.Grant, values []map[string]any, ...) (int64, error) + func (q *RunQuery) Value(ctx context.Context, g auth.Grant, column string) (any, error) + func (q *RunQuery) ValueOrFail(ctx context.Context, g auth.Grant, column string) (any, error) + func (q *RunQuery) Where(column any, args ...any) *RunQuery + func (q *RunQuery) WhereBelongsTo(relationshipName string, related ...model.Entity) *RunQuery + func (q *RunQuery) WhereBetween(column any, from, to any) *RunQuery + func (q *RunQuery) WhereColumn(first any, args ...any) *RunQuery + func (q *RunQuery) WhereDoesntHave(relation string, callback func(*query.Builder)) *RunQuery + func (q *RunQuery) WhereExists(callback func(*query.Builder)) *RunQuery + func (q *RunQuery) WhereHas(relation string, callback func(*query.Builder)) *RunQuery + func (q *RunQuery) WhereHasCount(relation string, callback func(*query.Builder), operator string, count int) *RunQuery + func (q *RunQuery) WhereIn(column any, values []any) *RunQuery + func (q *RunQuery) WhereKey(id any) *RunQuery + func (q *RunQuery) WhereNot(column any, args ...any) *RunQuery + func (q *RunQuery) WhereNotExists(callback func(*query.Builder)) *RunQuery + func (q *RunQuery) WhereNotIn(column any, values []any) *RunQuery + func (q *RunQuery) WhereNotNull(columns ...any) *RunQuery + func (q *RunQuery) WhereNull(columns ...any) *RunQuery + func (q *RunQuery) WhereRelation(relation string, column any, args ...any) *RunQuery + func (q *RunQuery) With(relations ...string) *RunQuery + func (q *RunQuery) WithAvg(relation, column string) *RunQuery + func (q *RunQuery) WithCount(relations ...string) *RunQuery + func (q *RunQuery) WithExists(relation string) *RunQuery + func (q *RunQuery) WithMax(relation, column string) *RunQuery + func (q *RunQuery) WithMin(relation, column string) *RunQuery + func (q *RunQuery) WithSum(relation, column string) *RunQuery + func (q *RunQuery) Without(relations ...string) *RunQuery + func (q *RunQuery) WithoutGlobalScope(identifier string) *RunQuery + func (q *RunQuery) WithoutGlobalScopes(identifiers ...string) *RunQuery + type RunRow struct + Active bool + Created int64 + Definition string + DefinitionLabel string + FileName string + Finished string + Format string + ID string + IsExport bool + IsFinished bool + IsImport bool + Kind string + KindLabel string + Percent int + Processed int64 + Refused int64 + Result string + Size string + Status string + StatusKey string + StatusVariant string + Total int64 + URL string + Unchanged int64 + Updated int64 + When string + WhenISO string + type Screen struct + Labels Labels + Location *time.Location + URLs URLs + func (s Screen) All() []string + func (s Screen) Chrome() any + func (s Screen) ErrorSummary() []string + func (s Screen) FieldErrors(name string) []string + func (s Screen) Form() FormState + func (s Screen) HasErrors() bool + func (s Screen) LogValue() slog.Value + func (s Screen) MarshalJSON() ([]byte, error) + func (s Screen) SearchLabel(table string) string + func (s Screen) StatusOptions() []components.SelectOption + func (s Screen) TableLines() components.DataTableLines + func (s Screen) When(t time.Time) string + type Service struct + func NewService(db *data.DB, cfg Config) *Service + func (s *Service) Clean(ctx context.Context) error + func (s *Service) Confirm(ctx context.Context, actor security.Subject, key, id string) (*Run, error) + func (s *Service) Discard(ctx context.Context, actor security.Subject, key, id string) error + func (s *Service) Find(ctx context.Context, actor security.Subject, key, id string) (*Run, error) + func (s *Service) List(ctx context.Context, actor security.Subject, q ListQuery) (Page, error) + func (s *Service) Open(ctx context.Context, actor security.Subject, key, id string, report bool) (*Run, Download, error) + func (s *Service) RequestExport(ctx context.Context, actor security.Subject, key, format string) (*Run, error) + func (s *Service) Template(ctx context.Context, actor security.Subject, key, format string, w io.Writer) (name, kind string, err error) + func (s *Service) Upload(ctx context.Context, actor security.Subject, key string, in Upload) (*Run, error) + type ShowPageData struct + BackURL string + CanConfirm bool + ConfirmURL string + Definition DefinitionView + DiscardURL string + Failure string + FileURL string + HasFile bool + HasReport bool + Header bool + Heads []string + Ignored string + Indeterminate bool + Invalid int + Mapped []MappedRow + MoreProblem int + Polling bool + Problems []LineRow + ProgressURL string + RefusedURL string + Retention int + Run RunRow + Sample []LineRow + Valid int + func (d ShowPageData) ExportDoneLead() string + func (d ShowPageData) HeaderNote() string + func (d ShowPageData) IgnoredText() string + func (d ShowPageData) KeepNote() string + func (d ShowPageData) MoreText(report bool) string + func (d ShowPageData) ProgressLead() string + func (d ShowPageData) ProgressTitle() string + func (d ShowPageData) StartedText() string + type Status string + const StatusDiscarded + const StatusDone + const StatusFailed + const StatusQueued + const StatusRunning + const StatusUploaded + func (s Status) Active() bool + func (s Status) Valid() bool + type Summary struct + Created int + Definition string + Refused int + Total int + Unchanged int + Updated int + type URLs struct + func NewURLs(prefix string, paths Paths) URLs + func (u URLs) Confirm(key, id string) string + func (u URLs) Definition(key string) string + func (u URLs) Discard(key, id string) string + func (u URLs) Export(key string) string + func (u URLs) File(key, id string) string + func (u URLs) Index() string + func (u URLs) Progress(key, id string) string + func (u URLs) Refused(key, id string) string + func (u URLs) Run(key, id string) string + func (u URLs) Template(key, format string) string + type Upload struct + Body io.Reader + Name string