Documentation
¶
Index ¶
- func TrimIfEnabled(trimEnabled bool, field TrimmableField, changes SanitizationResult) bool
- func TrimMultipleFields(trimEnabled bool, fields []TrimmableField, changes SanitizationResult) int
- func TrimWhitespaceField(field TrimmableField, changes SanitizationResult) bool
- type SanitizationResult
- type TrimmableField
- type TrimmableFieldsBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrimIfEnabled ¶
func TrimIfEnabled(trimEnabled bool, field TrimmableField, changes SanitizationResult) bool
TrimIfEnabled conditionally trims a field if trimEnabled is true Returns true if the value was changed, false otherwise.
func TrimMultipleFields ¶
func TrimMultipleFields(trimEnabled bool, fields []TrimmableField, changes SanitizationResult) int
TrimMultipleFields trims multiple fields with the same configuration Returns the count of fields that were actually changed.
func TrimWhitespaceField ¶
func TrimWhitespaceField(field TrimmableField, changes SanitizationResult) bool
TrimWhitespaceField trims whitespace from a string field and tracks changes Returns true if the value was changed, false otherwise.
Types ¶
type SanitizationResult ¶
SanitizationResult interface for change tracking.
type TrimmableField ¶
type TrimmableField struct {
Name string // Field name for identification
Value *string // Pointer to string value to modify
Path string // Full path for change tracking
Original string // Original value (if needed separately)
}
TrimmableField represents a string field that can be trimmed.
type TrimmableFieldsBuilder ¶
type TrimmableFieldsBuilder struct {
// contains filtered or unexported fields
}
TrimmableFieldsBuilder helps build trimmable field configurations.
func NewTrimmableFieldsBuilder ¶
func NewTrimmableFieldsBuilder() *TrimmableFieldsBuilder
NewTrimmableFieldsBuilder creates a new builder for trimmable fields.
func (*TrimmableFieldsBuilder) AddField ¶
func (b *TrimmableFieldsBuilder) AddField( name, path string, value *string, ) *TrimmableFieldsBuilder
AddField adds a trimmable field to the builder.
func (*TrimmableFieldsBuilder) Build ¶
func (b *TrimmableFieldsBuilder) Build() []TrimmableField
Build returns the configured trimmable fields.