formtask

package
v0.51.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUploadIDWithTaskContext

func GenerateUploadIDWithTaskContext(ctx context.Context, formId string) string

GenerateUploadIDWithTaskContext generates the upload ID from form ID and task ID.

Types

type FileFormTaskBuilder

type FileFormTaskBuilder struct {
	FormTaskBuilderBase[upload.UploadResult]
	// contains filtered or unexported fields
}

func (*FileFormTaskBuilder) Build

func (*FileFormTaskBuilder) WithDependencies

func (b *FileFormTaskBuilder) WithDependencies(dependencies []taskid.UntypedTaskReference) *FileFormTaskBuilder

WithDependencies sets the task dependencies

func (*FileFormTaskBuilder) WithDescription

func (b *FileFormTaskBuilder) WithDescription(description string) *FileFormTaskBuilder

WithDescription sets the description for the form field

type FormTaskBuilderBase

type FormTaskBuilderBase[T any] struct {
	// contains filtered or unexported fields
}

FormTaskBuilderBase provides common functionality for form task builders

func NewFormTaskBuilderBase

func NewFormTaskBuilderBase[T any](id taskid.TaskImplementationID[T], priority int, label string) FormTaskBuilderBase[T]

NewFormTaskBuilderBase creates a new instance of the base builder

func (*FormTaskBuilderBase[T]) SetupBaseFormField

func (b *FormTaskBuilderBase[T]) SetupBaseFormField(field *inspectionmetadata.ParameterFormFieldBase)

SetupBaseFormField configures common form field properties

func (*FormTaskBuilderBase[T]) WithDependencies

func (b *FormTaskBuilderBase[T]) WithDependencies(dependencies []taskid.UntypedTaskReference) *FormTaskBuilderBase[T]

WithDependencies sets the task dependencies

func (*FormTaskBuilderBase[T]) WithDescription

func (b *FormTaskBuilderBase[T]) WithDescription(description string) *FormTaskBuilderBase[T]

WithDescription sets the description for the form field

type SetFormBoolProvider added in v0.51.0

type SetFormBoolProvider = func(ctx context.Context) (bool, error)

SetFormBoolProvider is a function type to provide boolean flags dynamically.

type SetFormDefaultValueGenerator added in v0.51.0

type SetFormDefaultValueGenerator = func(ctx context.Context, previousValues []string) ([]string, error)

SetFormDefaultValueGenerator is a function type to generate the default value.

type SetFormHintGenerator added in v0.51.0

type SetFormHintGenerator = func(ctx context.Context, value []string, convertedValue any) (string, inspectionmetadata.ParameterHintType, error)

SetFormHintGenerator is a function type to generate a hint string

type SetFormOptionsProvider added in v0.51.0

type SetFormOptionsProvider = func(ctx context.Context, previousValues []string) ([]inspectionmetadata.SetParameterFormFieldOptionItem, error)

SetFormOptionsProvider is a function to return the list of options.

type SetFormTaskBuilder added in v0.51.0

type SetFormTaskBuilder[T any] struct {
	FormTaskBuilderBase[T]
	// contains filtered or unexported fields
}

SetFormTaskBuilder is an utility to construct an instance of task for input form field.

func NewSetFormTaskBuilder added in v0.51.0

func NewSetFormTaskBuilder[T any](id taskid.TaskImplementationID[T], priority int, fieldLabel string) *SetFormTaskBuilder[T]

NewSetFormTaskBuilder constructs an instance of SetFormTaskBuilder.

func (*SetFormTaskBuilder[T]) Build added in v0.51.0

func (b *SetFormTaskBuilder[T]) Build(labelOpts ...common_task.LabelOpt) common_task.Task[T]

func (*SetFormTaskBuilder[T]) WithAllowAddAll added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowAddAll(allow bool) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithAllowAddAllFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowAddAllFunc(allowFunc SetFormBoolProvider) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithAllowCustomValue added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowCustomValue(allow bool) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithAllowCustomValueFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowCustomValueFunc(allowFunc SetFormBoolProvider) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithAllowRemoveAll added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowRemoveAll(allow bool) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithAllowRemoveAllFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithAllowRemoveAllFunc(allowFunc SetFormBoolProvider) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithConverter added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithConverter(converter SetFormValueConverter[T]) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithDefaultValueConstant added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithDefaultValueConstant(defValue []string, preferPrevValue bool) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithDefaultValueFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithDefaultValueFunc(defFunc SetFormDefaultValueGenerator) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithDependencies added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithDependencies(dependencies []taskid.UntypedTaskReference) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithDescription added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithDescription(description string) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithHintFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithHintFunc(hintFunc SetFormHintGenerator) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithOptionsConstant added in v0.51.0

func (*SetFormTaskBuilder[T]) WithOptionsFunc added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithOptionsFunc(optionsFunc SetFormOptionsProvider) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithOptionsSimple added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithOptionsSimple(options []string) *SetFormTaskBuilder[T]

func (*SetFormTaskBuilder[T]) WithValidator added in v0.51.0

func (b *SetFormTaskBuilder[T]) WithValidator(validator SetFormValidator) *SetFormTaskBuilder[T]

type SetFormValidator added in v0.51.0

type SetFormValidator = func(ctx context.Context, value []string) (string, error)

SetFormValidator is a function to check if the given value is valid or not.

type SetFormValueConverter added in v0.51.0

type SetFormValueConverter[T any] = func(ctx context.Context, value []string) (T, error)

SetFormValueConverter is a function type to convert the given string slice value to another type stored in the variable set.

type TextFormDefaultValueGenerator

type TextFormDefaultValueGenerator = func(ctx context.Context, previousValues []string) (string, error)

TextFormDefaultValueGenerator is a function type to generate the default value.

type TextFormHintGenerator

type TextFormHintGenerator = func(ctx context.Context, value string, convertedValue any) (string, inspectionmetadata.ParameterHintType, error)

TextFormHintGenerator is a function type to generate a hint string

type TextFormReadonlyProvider

type TextFormReadonlyProvider = func(ctx context.Context) (bool, error)

TextFormReadonlyProvider is a function type to compute if the field is allowed edit or not.

type TextFormSuggestionsProvider

type TextFormSuggestionsProvider = func(ctx context.Context, value string, previousValues []string) ([]string, error)

TextFormSuggestionsProvider is a function to return the list of strings shown in the autocomplete. Return nil instead of emptry string array means the autocomplete is disabled for the field.

type TextFormTaskBuilder

type TextFormTaskBuilder[T any] struct {
	FormTaskBuilderBase[T]
	// contains filtered or unexported fields
}

TextFormTaskBuilder is an utility to construct an instance of task for input form field. This will generate the task instance with `Build()` method call after chaining several configuration methods.

func NewTextFormTaskBuilder

func NewTextFormTaskBuilder[T any](id taskid.TaskImplementationID[T], priority int, fieldLabel string) *TextFormTaskBuilder[T]

NewTextFormTaskBuilder constructs an instace of TextFormDefinitionBuilder. id,prioirity and label will be initialized with the value given in the argument. The other values are initialized with the following values. dependencies : Initialized with an empty string array indicating this task is not depending on anything. description: Initialized with an empty string. defaultValue: Initialized with a function to return empty string. validator: Initialized with a function to return empty string that indicates the validation is always passing. allowEditProvider: Initialized with a function to return true. suggestionsProvider: Initialized with a function to return nil. converter: Initialized with a function to return the given value. This means no conversion applied and treated as a string.

func (*TextFormTaskBuilder[T]) Build

func (b *TextFormTaskBuilder[T]) Build(labelOpts ...common_task.LabelOpt) common_task.Task[T]

func (*TextFormTaskBuilder[T]) WithConverter

func (b *TextFormTaskBuilder[T]) WithConverter(converter TextFormValueConverter[T]) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithDefaultValueConstant

func (b *TextFormTaskBuilder[T]) WithDefaultValueConstant(defValue string, preferPrevValue bool) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithDefaultValueFunc

func (b *TextFormTaskBuilder[T]) WithDefaultValueFunc(defFunc TextFormDefaultValueGenerator) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithDependencies

func (b *TextFormTaskBuilder[T]) WithDependencies(dependencies []taskid.UntypedTaskReference) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithDescription

func (b *TextFormTaskBuilder[T]) WithDescription(description string) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithHintFunc

func (b *TextFormTaskBuilder[T]) WithHintFunc(hintFunc TextFormHintGenerator) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithReadonlyFunc

func (b *TextFormTaskBuilder[T]) WithReadonlyFunc(readonlyFunc TextFormReadonlyProvider) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithSuggestionsConstant

func (b *TextFormTaskBuilder[T]) WithSuggestionsConstant(suggestions []string) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithSuggestionsFunc

func (b *TextFormTaskBuilder[T]) WithSuggestionsFunc(suggestionsFunc TextFormSuggestionsProvider) *TextFormTaskBuilder[T]

func (*TextFormTaskBuilder[T]) WithValidatingTiming

func (*TextFormTaskBuilder[T]) WithValidator

func (b *TextFormTaskBuilder[T]) WithValidator(validator TextFormValidator) *TextFormTaskBuilder[T]

type TextFormValidator

type TextFormValidator = func(ctx context.Context, value string) (string, error)

TextFormValidator is a function to check if the given value is valid or not. Returns "" as the result when it has no error, otherwise the returned value is used as an error message on frontend. Returning an error as the 2nd returning value is only when the validator detects an unrecoverble error.

type TextFormValueConverter

type TextFormValueConverter[T any] = func(ctx context.Context, value string) (T, error)

TextFormValueConverter is a function type to convert the given string value to another type stored in the variable set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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