devreport

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package devreport is what dev mode (BACKD_DEV) says when a config doesn't load: the problems it holds, each with where it is, the tool's output and what to do, for the log and for the dev landing page and API answers.

Index

Constants

View Source
const (
	Config = "config" // a file of CONFIG_DIR, or the config as a whole
	Rules  = "rules"  // a collection's rules
	Build  = "build"  // bundling a database's functions
)

Problem kinds: what failed when a config didn't load in dev mode.

View Source
const ConfigPrefix = "invalid config:\n"

ConfigPrefix starts the error of a config that does not load.

Variables

This section is empty.

Functions

func Log

func Log(log *slog.Logger, msg string, problems []Problem, seen map[string]bool)

Log writes one error record per problem not in seen (and adds it there), with msg saying what dev mode does about it.

Types

type BuildError

type BuildError struct{ Err error }

BuildError marks an error of bundling the functions, so its report has kind build.

func (BuildError) Error

func (e BuildError) Error() string

func (BuildError) Unwrap

func (e BuildError) Unwrap() error

type Problem

type Problem struct {
	Kind    string `json:"kind"`
	File    string `json:"file,omitempty"` // relative to CONFIG_DIR, when known
	Line    int    `json:"line,omitempty"` // when known
	Message string `json:"message"`
	Output  string `json:"output,omitempty"` // the tool's output as it is (Deno's, for a build)
	Hint    string `json:"hint"`
}

Problem is one reason a config didn't load, as dev mode reports it: in one log record and on the API root.

func Of

func Of(err error, configDir string) []Problem

Of splits an error of loading the config into the problems it holds: one per file error of the config (errors.Join), and one for a build, with Deno's output.

func (Problem) Key

func (p Problem) Key() string

Key identifies a problem, so a report repeated without change is logged once.

func (Problem) Location

func (p Problem) Location() string

Location is where the problem is: "file:line", "file", or "" when it isn't in one file.

func (Problem) String

func (p Problem) String() string

String is the problem on one line: where, then what ("app/realm.yaml:2: …").

Jump to

Keyboard shortcuts

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