validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package validation checks FYT configuration and time entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDeprecations

func ConfigDeprecations(obj *core.Config) (out []string)

ConfigDeprecations is used to file warnings on create, update events.

func OnCreateConfig

func OnCreateConfig(entry *core.Config) field.ErrorList

OnCreateConfig validates every section of a Config on create.

func OnCreateTimeEntry

func OnCreateTimeEntry(entry *core.TimeEntry) (errorList field.ErrorList)

OnCreateTimeEntry is the validation entry point for creating a core.TimeEntry.

func OnUpdateConfig

func OnUpdateConfig(oldObj, newObj *core.Config) (errorList field.ErrorList)

OnUpdateConfig runs validation over core.Config object on update event.

func OnUpdateTimeEntry

func OnUpdateTimeEntry(oldObj, newObj *core.TimeEntry) (errorList field.ErrorList)

OnUpdateTimeEntry validates the new core.TimeEntry using the creation rules. Update-specific validation rules will be added separately.

func TimeEntryDeprecations

func TimeEntryDeprecations(obj *core.TimeEntry) (out []string)

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

func ValidateInvoiceConfig(entry *core.Config) (errorList field.ErrorList)

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

type ConfigValidationOptions struct {
	Reports bool
	Invoice bool
}

ConfigValidationOptions selects the document settings to validate.

Jump to

Keyboard shortcuts

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