Document application-owned alias contracts
This commit is contained in:
11
registry.go
11
registry.go
@@ -9,10 +9,13 @@ import (
|
||||
"gitea.maximumdirect.net/eric/CommandKit/internal/commandpath"
|
||||
)
|
||||
|
||||
// Register adds a batch of declarations to the application. The complete batch
|
||||
// is validated before registry mutation; on error the registry and its derived
|
||||
// command metadata remain unchanged. A successful nonempty batch becomes
|
||||
// visible to later invocations. Declarations remain reusable.
|
||||
// Register adds a batch of canonical commands and routing rules to the
|
||||
// application. The complete batch is validated before registry mutation; on
|
||||
// error the registry and its derived command metadata remain unchanged. A
|
||||
// successful nonempty batch becomes visible to later invocations. Declarations
|
||||
// remain reusable. Identical duplicate routing mappings are accepted, while
|
||||
// competing targets for the same source are errors. Nil and zero declarations
|
||||
// are invalid; use NoCommand for an intentionally absent optional command.
|
||||
func (a *App) Register(declarations ...Declaration) error {
|
||||
return a.installBatch(declarations...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user