domains

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

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) AddConst

func (e *Entry) AddConst(pkg string, id model.Ident)

AddConst adds a constant declaration to the entry.

func (*Entry) AddFunction

func (e *Entry) AddFunction(pkg string, fn model.Function)

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) AddType

func (e *Entry) AddType(pkg string, id model.Ident)

AddType adds a type declaration to the entry.

func (*Entry) AddVariable

func (e *Entry) AddVariable(pkg string, id model.Ident)

AddVariable adds a variable declaration to the entry.

func (Entry) Consts

func (e Entry) Consts() []model.Ident

Consts returns the list of constant declarations in this domain.

func (Entry) Description

func (e Entry) Description() string

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

func (e Entry) Functions() []model.Function

Functions returns the list of functions in this domain from the assertions package.

func (Entry) Len

func (e Entry) Len() (l int)

Len returns the number of (filtered) functions for this entry.

func (Entry) Types

func (e Entry) Types() []model.Ident

Types returns the list of type declarations in this domain.

func (Entry) Vars

func (e Entry) Vars() []model.Ident

Vars returns the list of variable declarations in this domain.

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index represents a domain-based index of assertions organized by domain.

func MakeDomainIndex

func MakeDomainIndex(docs map[string]model.Document) Index

MakeDomainIndex creates a domain-based index from flattened documentation.

func (Index) Copyright

func (idx Index) Copyright() string

Copyright returns the copyright string.

func (Index) Entries

func (idx Index) Entries() iter.Seq2[string, Entry]

Entries returns an iterator over domain entries, sorted alphabetically with "common" domain last.

func (Index) Header

func (idx Index) Header() string

Header returns the header prepared by the Scanner.

func (Index) Receiver

func (idx Index) Receiver() string

Receiver returns the receiver name.

func (Index) RootPackage

func (idx Index) RootPackage() string

RootPackage returns the root package path.

func (Index) Tool

func (idx Index) Tool() string

Tool returns the tool name.

Jump to

Keyboard shortcuts

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