Documentation
¶
Overview ¶
Package validation checks FYT configuration and time entries.
Index ¶
- func ConfigDeprecations(obj *core.Config) (out []string)
- func OnCreateConfig(entry *core.Config) field.ErrorList
- func OnCreateTimeEntry(entry *core.TimeEntry) (errorList field.ErrorList)
- func OnUpdateConfig(oldObj, newObj *core.Config) (errorList field.ErrorList)
- func OnUpdateTimeEntry(oldObj, newObj *core.TimeEntry) (errorList field.ErrorList)
- func TimeEntryDeprecations(obj *core.TimeEntry) (out []string)
- func ValidateConfig(entry *core.Config, options ConfigValidationOptions) (errorList field.ErrorList)
- func ValidateInvoiceConfig(entry *core.Config) (errorList field.ErrorList)
- func ValidateVersionedCreate[Internal any](object runtime.Object, validate func(*Internal) field.ErrorList) (field.ErrorList, error)
- func ValidateVersionedUpdate[Internal any](oldObject, newObject runtime.Object, ...) (field.ErrorList, error)
- type ConfigValidationOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDeprecations ¶
ConfigDeprecations is used to file warnings on create, update events.
func OnCreateConfig ¶
OnCreateConfig validates every section of a Config on create.
func OnCreateTimeEntry ¶
OnCreateTimeEntry is the validation entry point for creating a core.TimeEntry.
func OnUpdateConfig ¶
OnUpdateConfig runs validation over core.Config object on update event.
func OnUpdateTimeEntry ¶
OnUpdateTimeEntry validates the new core.TimeEntry using the creation rules. Update-specific validation rules will be added separately.
func TimeEntryDeprecations ¶
TimeEntryDeprecations returns warnings for deprecated core.TimeEntry fields. No deprecations are currently defined.
func ValidateConfig ¶
func ValidateConfig(entry *core.Config, options ConfigValidationOptions) (errorList field.ErrorList)
ValidateConfig validates shared settings and the selected document settings.
func ValidateInvoiceConfig ¶
ValidateInvoiceConfig validates the invoice section of a Config.
func ValidateVersionedCreate ¶
func ValidateVersionedCreate[Internal any](object runtime.Object, validate func(*Internal) field.ErrorList) (field.ErrorList, error)
ValidateVersionedCreate converts a non-nil versioned object and runs its create validator. It returns field violations separately from conversion errors. The validator must treat the converted object as read-only because it may share data with the input.
func ValidateVersionedUpdate ¶
func ValidateVersionedUpdate[Internal any]( oldObject, newObject runtime.Object, validate func(*Internal, *Internal) field.ErrorList, ) (field.ErrorList, error)
ValidateVersionedUpdate converts two non-nil versioned objects and passes the old object first and the new object second to validate. If either conversion fails, it returns the error without calling the validator. The validator must treat both converted objects as read-only because they may share input data.
Types ¶
type ConfigValidationOptions ¶
ConfigValidationOptions selects the document settings to validate.