Documentation
¶
Overview ¶
Package domains provides domain-based organization of assertions for documentation generation.
This package handles the reorganization of assertion functions, types, variables, and constants from package-based organization (assert, require, internal/assertions) to domain-based organization (boolean, collection, error, etc.) for documentation purposes.
Index ¶
- func FlattenDocumentation(documentation model.Documentation) map[string]model.Document
- type Entry
- func (e *Entry) AddConst(pkg string, id model.Ident)
- func (e *Entry) AddFunction(pkg string, fn model.Function)
- func (e *Entry) AddPackage(pkg string, apkg *model.AssertionPackage)
- func (e *Entry) AddType(pkg string, id model.Ident)
- func (e *Entry) AddVariable(pkg string, id model.Ident)
- func (e Entry) Consts() []model.Ident
- func (e Entry) Description() string
- func (e Entry) ExtraPackages() model.ExtraPackages
- func (e Entry) Functions() []model.Function
- func (e Entry) Len() (l int)
- func (e Entry) Types() []model.Ident
- func (e Entry) Vars() []model.Ident
- type Index
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenDocumentation ¶
func FlattenDocumentation(documentation model.Documentation) map[string]model.Document
FlattenDocumentation flattens a nested documentation structure into a map of packages.
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents a discovered domain entry with associated functions, types, variables, and constants.
func (*Entry) AddFunction ¶
AddFunction adds a function to the entry.
func (*Entry) AddPackage ¶
func (e *Entry) AddPackage(pkg string, apkg *model.AssertionPackage)
AddPackage adds a package to the entry.
func (*Entry) AddVariable ¶
AddVariable adds a variable declaration to the entry.
func (Entry) Description ¶
Description returns the description of this domain.
func (Entry) ExtraPackages ¶
func (e Entry) ExtraPackages() model.ExtraPackages
ExtraPackages returns the list of extra packages (excluding the assertions package).
This should correspond to the generated packages, e.g. "assert" and "require".
func (Entry) Functions ¶
Functions returns the list of functions in this domain from the assertions package.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index represents a domain-based index of assertions organized by domain.
func MakeDomainIndex ¶
MakeDomainIndex creates a domain-based index from flattened documentation.
func (Index) Entries ¶
Entries returns an iterator over domain entries, sorted alphabetically with "common" domain last.
func (Index) RootPackage ¶
RootPackage returns the root package path.