describe

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 18 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, of its local setup in dev.yaml, never a value of 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"`
	// Local is the app's local setup for aicoded dev.
	Local Local `json:"local"`
}

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 Local added in v0.12.0

type Local struct {
	// Workspace is the folder described when dev.yaml holds settings for it, as aicoded dev run
	// there uses them, or "" when it holds none, and aicoded dev runs with its defaults.
	Workspace string `json:"workspace"`
	// Note says what aicoded dev does when dev.yaml holds no settings for the folder, and names
	// the nearest folder above it that dev.yaml holds settings for.
	Note string `json:"note,omitempty"`
	// Problem is why aicoded dev cannot read dev.yaml, or nil.
	Problem *problem.Problem `json:"problem,omitempty"`
	// MySQL is whether dev.yaml names a local MySQL server, for an app that declares sqldb.
	MySQL *bool `json:"mysql,omitempty"`
	// Personas are the personas dev.yaml names. When it names none, aicoded dev signs in as
	// all-roles, with every role the apps ask for, or as no-roles.
	Personas []Persona `json:"personas,omitempty"`
	// Settings and Secrets are those the permission list declares, each with whether dev.yaml
	// sets a local value for it.
	Settings []Value `json:"settings,omitempty"`
	Secrets  []Value `json:"secrets,omitempty"`
}

Local is what dev.yaml sets for an app in aicoded dev: names, and whether each value is set, never a value.

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 Persona added in v0.12.0

type Persona struct {
	Name   string   `json:"name"`
	Roles  []string `json:"roles,omitempty"`
	Groups []string `json:"groups,omitempty"`
}

Persona is a test viewer of aicoded dev: its name, roles and groups.

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.

type Value added in v0.12.0

type Value struct {
	Name string `json:"name"`
	Set  bool   `json:"set"`
}

Value is a setting or secret by name, and whether a local value is set for it.

Jump to

Keyboard shortcuts

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