Resource.WithRequiredCommandValidation
Method
func (Resource) WithRequiredCommandValidation( command string, validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult, options ...*WithRequiredCommandValidationOptions,) ResourceSignature
method
WithRequiredCommandValidation builderDeclares that a resource requires a specific command/executable to be available on the local machine PATH before it can start, with custom validation logic.
WithRequiredCommandValidation( command string, validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult, options ...*WithRequiredCommandValidationOptions,) ResourceParameters
commandstringThe command string (file name or path) that should be validated.validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult callbackA callback that validates the resolved command path. Receives a RequiredCommandValidationContext and returns a RequiredCommandValidationResult .options...*WithRequiredCommandValidationOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithRequiredCommandValidationOptions argument.
HelpLink *stringAn optional help link URL to guide users when the command is missing or fails validation.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
Defined on
A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.
Applies to
This function applies to the following types: