Documentation
¶
Overview ¶
Package apidoc renders the framework's public Go API from its sources as the app resolves them (its go.mod, replace directives included), so an agent reads the signatures it can call instead of guessing them. `lidza api` prints it; `lidza mcp` serves it as lidza://api and lidza_api.
Index ¶
- Constants
- Variables
- func AppPackages(moduleDir string) []string
- func Exists(moduleDir, importPath string) bool
- func ImportPath(rel string) string
- func Listing(ctx context.Context, dir string) (string, error)
- func ModuleDir(ctx context.Context, dir string) (string, error)
- func Packages(moduleDir string) ([]string, error)
- func Rel(importPath string) (rel string, ok bool)
- func Render(moduleDir string, rels []string, filter string) (string, error)
- func Suggest(moduleDir, importPath string) string
- type Source
- func (s Source) Exists(p string) bool
- func (s Source) ImportPath(rel string) string
- func (s Source) Index(rels []string, filter string) (string, error)
- func (s Source) Packages() ([]string, error)
- func (s Source) Rel(p string) (rel string, ok bool)
- func (s Source) Render(rels []string, filter string) (string, error)
Constants ¶
const Module = "github.com/agim/lidza"
Module is the framework's module path.
Variables ¶
var Public = []string{"", "pkg/router", "pkg/middleware", "pkg/lidzatest", "pkg/report", "pkg/resilience", "pkg/env", "pkg/decimal", "pkg/webhook"}
Public lists the packages app code imports, relative to the module root ("" is the root package). Every packs/<name> package is public too.
Functions ¶
func AppPackages ¶
AppPackages is Public plus the pack packages present at moduleDir.
func ImportPath ¶
ImportPath is the import path of a package relative path.
func Listing ¶
Listing names the project's packages, then the framework's, one per line with a note on which are the app's and which are framework internals.
func ModuleDir ¶
ModuleDir returns the directory holding the framework's sources for the project in dir: dir itself when it is the framework, otherwise what the go tool resolves from the project's go.mod.
func Packages ¶
Packages lists every importable package of the module at moduleDir, relative to it, "" for the root. Commands, internal, test data, examples, node_modules and nested modules are left out.
func Rel ¶
Rel turns an import path under the module into its relative path; ok is false for paths outside the module.
Types ¶
type Source ¶
type Source struct {
// Dir holds the module's sources.
Dir string
// Module is its module path.
Module string
}
Source is a Go module to render: the framework as the app resolves it, or the app itself.
func Resolve ¶
Resolve picks the source and packages a request names: "" is the framework's app-facing packages, "app" every package of the project, "./rel" or the project's import path one of the project's, and anything else a framework package (import path or path relative to the framework module). The error for an unknown package names both listings.
func (Source) Exists ¶
Exists reports whether p (an import path or "./rel") names a package of the source.
func (Source) ImportPath ¶
ImportPath is the import path of rel within the source.
func (Source) Index ¶
Index is Render without the doc comments, one line per declaration: the signatures of a package too large to read whole, to pick what to ask for with a filter.
func (Source) Packages ¶
Packages lists the source's packages, including internal packages owned by an application. Framework sources retain their public package boundary.