Clarify inspection input ownership and documentation
This commit is contained in:
@@ -33,10 +33,17 @@ type ProfileRequest struct {
|
||||
|
||||
// Suite describes application-owned input, shared state, and named inspection
|
||||
// capabilities. Its private issues retain adapter construction failures.
|
||||
// Factory results and callback effects remain caller-owned: Command does not
|
||||
// deep-copy arbitrary objects or repair aliases returned by factories.
|
||||
// Factories are not invoked during construction, installation, help, or version,
|
||||
// and need not run after failure.
|
||||
type Suite[I, S any] struct {
|
||||
// NewInput creates input storage once for the selected definition command.
|
||||
// NewInput is called once when definition input preparation is reached,
|
||||
// before applying selectors and calling CheckInput.
|
||||
// If nil, input is the zero value of I, including nil for pointer types.
|
||||
NewInput func() I
|
||||
// NewState creates shared inspection state once for that invocation.
|
||||
// NewState is called once when inspection is reached, after input checks
|
||||
// pass. If nil, state is the zero value of S, including nil for pointer types.
|
||||
NewState func() S
|
||||
// Selectors declares the original typed flags accepted by definition commands.
|
||||
Selectors []commandkit.Flag[I]
|
||||
|
||||
Reference in New Issue
Block a user