workspace

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: 8 Imported by: 0

Documentation

Overview

Package workspace finds the apps of a workspace: the folders under its root that hold a permission list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(root string) ([]string, error)

Discover returns the absolute paths of the folders under root, root included, that hold aicoded.yaml, sorted. It resolves the symbolic links in root's path, and follows none below it. It does not look inside an app's folder, nor inside folders whose names start with . or _, or are vendor, node_modules or testdata.

func Find

func Find(root, app string) (string, error)

Find returns the folder of the app named app among the apps Discover finds under root. It refuses, with E-RPC-007, a name that no app there has, or that two have.

func Names

func Names(apps []App) map[string]string

Names maps the name of each app to its folder.

func SameName

func SameName(name, a, b string) error

SameName is E-DEV-010 for the apps in the folders a and b, which are both named name.

func UnknownApp

func UnknownApp(name string) error

UnknownApp is E-DEV-014 for name, which no app of the workspace has; name may be any text.

Types

type App

type App struct{ Name, Dir string }

App is one app of a workspace: the name on the app: line of its permission list, and its folder.

func Apps

func Apps(root string) ([]App, error)

Apps returns the apps under root in folder order. It fails with E-MAN-006 when there is none, with E-DEV-010 when two have one name, and with the error of a permission list that does not load.

func Select

func Select(apps []App, name string) ([]App, error)

Select returns the app of apps named name, or every app when name is "". It fails with E-DEV-014 when no app has the name.

Jump to

Keyboard shortcuts

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