describe

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package describe runs aicoded describe: a compact summary of what each app of a workspace serves, calls and may reach, from its permission list, of its surface, of what is out of date in it, and, in JSON, of its pages and layouts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name       string              `json:"name"`
	Dir        string              `json:"dir"`
	Class      string              `json:"class,omitempty"`
	Owner      string              `json:"owner,omitempty"`
	Audience   *Audience           `json:"audience,omitempty"`
	Pages      []Page              `json:"pages,omitempty"`
	Serves     []Serve             `json:"serves,omitempty"`
	Calls      map[string][]string `json:"calls,omitempty"`
	SQLDB      bool                `json:"sqldb,omitempty"`
	Stores     []string            `json:"stores,omitempty"`
	Connectors []string            `json:"connectors,omitempty"`
	Email      *Email              `json:"email,omitempty"`
	Egress     []string            `json:"egress,omitempty"`
	Bindings   []Binding           `json:"bindings,omitempty"`
	Schedule   []Job               `json:"schedule,omitempty"`
	Settings   []string            `json:"settings,omitempty"`
	Secrets    []string            `json:"secrets,omitempty"` // names only
	Modules    []string            `json:"modules,omitempty"`
	Size       string              `json:"size,omitempty"`
	Resources  string              `json:"resources,omitempty"`
	TTL        string              `json:"ttl,omitempty"`
	// Surface is the app's size. Its writes come from lint, and are left out, with a warning, when
	// lint cannot read the app or its precheck stops it.
	Surface  surface.Surface `json:"surface"`
	Warnings []string        `json:"warnings,omitempty"`
	// Findings are the generated files that are out of date, E-CHK-001, and the errors of generate.
	Findings []problem.Problem `json:"findings,omitempty"`
	// Routes lists every page and layout, sorted by path, from the templates as aicoded generate
	// reads them. The text summary leaves them out.
	Routes []generate.RouteInfo `json:"routes,omitempty"`
}

App describes one app.

type Audience

type Audience struct {
	Internal []string `json:"internal,omitempty"`
	External []string `json:"external,omitempty"`
}

Audience is who may use the app: people of the company and outside people.

type Binding

type Binding struct {
	Host   string `json:"host"`
	Secret string `json:"secret"`
	Header string `json:"header"`
	Prefix string `json:"prefix,omitempty"`
}

Binding is a key the runner adds to every request to an outside service: the secret's name, never its value, the header it goes in and the text before it.

type Email

type Email struct {
	From      string   `json:"from"`
	ToDomains []string `json:"to_domains,omitempty"`
}

Email is where the app sends mail from and the domains it may send to.

type Job

type Job struct {
	Name string `json:"job"`
	Cron string `json:"cron"`
}

Job is one scheduled job and the cron expression, in UTC, of when it runs.

type Page

type Page struct {
	Path    string   `json:"path"`
	Require []string `json:"require"`
	Guard   bool     `json:"guard,omitempty"`
	Shared  bool     `json:"shared,omitempty"`
	Calls   []string `json:"calls,omitempty"`
}

Page is one page of the access section: its path, the role rules a viewer must meet, whether a Guard on its path decides who sees each record, whether everyone the rules admit may see every record, and the page calls it makes.

type Serve

type Serve struct {
	Name    string   `json:"name"`
	Callers []string `json:"callers"`
	Require []string `json:"require,omitempty"`
	Apps    bool     `json:"apps,omitempty"`
}

Serve is one function the app serves other apps.

type Summary

type Summary struct {
	Apps []App `json:"apps"`
}

Summary describes the apps of a workspace.

func Describe

func Describe(ctx context.Context, dir, app string) (Summary, error)

Describe summarises the app named app under dir, or every app when app is "". It never writes.

func (Summary) WriteText

func (s Summary) WriteText(w io.Writer) error

WriteText writes the summary as aicoded describe prints it: a compact block per app, with no line for what an app does not have.

Jump to

Keyboard shortcuts

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