Documentation
¶
Overview ¶
Package valueobject defines immutable value objects used across the domain layer. Includes Status, Complexity, Config, and Error types.
Index ¶
- type Complexity
- type ComplexityLevel
- type EnrichmentError
- type Status
- type TransformConfig
- func (c *TransformConfig) Clone() *TransformConfig
- func (c *TransformConfig) Validate() error
- func (c *TransformConfig) WithCacheDisabled() *TransformConfig
- func (c *TransformConfig) WithCacheTTL(ttl time.Duration) *TransformConfig
- func (c *TransformConfig) WithMaxPayloadSize(size int64) *TransformConfig
- func (c *TransformConfig) WithMaxTransformCount(count int) *TransformConfig
- func (c *TransformConfig) WithTimeout(timeout time.Duration) *TransformConfig
- type TransformError
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Complexity ¶
Complexity represents computational complexity metrics
func NewComplexity ¶
func NewComplexity(duration time.Duration, payloadSize int64, transformCount int) *Complexity
NewComplexity creates a new complexity measurement
func (*Complexity) IsCheap ¶
func (c *Complexity) IsCheap() bool
IsCheap returns true if complexity is low
func (*Complexity) IsExpensive ¶
func (c *Complexity) IsExpensive() bool
IsExpensive returns true if complexity is high
func (*Complexity) Level ¶
func (c *Complexity) Level() ComplexityLevel
Level calculates the complexity level based on all factors
func (*Complexity) String ¶
func (c *Complexity) String() string
String returns a human-readable complexity description
type ComplexityLevel ¶
type ComplexityLevel int
ComplexityLevel represents the computational complexity tier
const ( ComplexityVeryLow ComplexityLevel = iota // 0 - <5ms, <1KB, 1 transform ComplexityLow // 1 - <10ms, <10KB, 3 transforms ComplexityMedium // 2 - <100ms, <1MB, 5 transforms ComplexityHigh // 3 - <500ms, <10MB, 10 transforms ComplexityVeryHigh // 4 - >=500ms, >=10MB, 15+ transforms )
func (ComplexityLevel) String ¶
func (cl ComplexityLevel) String() string
String returns the string representation
type EnrichmentError ¶
EnrichmentError represents enrichment operation failures
func NewEnrichmentError ¶
func NewEnrichmentError(source, message string) *EnrichmentError
NewEnrichmentError creates a new enrichment error
func (*EnrichmentError) Error ¶
func (e *EnrichmentError) Error() string
Error implements the error interface
func (*EnrichmentError) Unwrap ¶
func (e *EnrichmentError) Unwrap() error
Unwrap returns the wrapped error for error chain inspection
type Status ¶
type Status int
Status represents the lifecycle state of a job
const ( StatusPending Status = iota // 0 - Job queued, waiting to be processed StatusProcessing // 1 - Job is currently being processed StatusSuccess // 2 - Job completed successfully (final) StatusFailed // 3 - Job failed with error (final) StatusCancelled // 4 - Job was cancelled by user (final) )
func (Status) CanTransitionTo ¶
CanTransitionTo checks if transition from current to target status is allowed
type TransformConfig ¶
type TransformConfig struct {
CacheEnabled bool
CacheTTL time.Duration
MaxTransformCount int
MaxPayloadSize int64
Timeout time.Duration
RetryAttempts int
CircuitBreakerOpen bool
}
TransformConfig holds transformation configuration
func NewTransformConfig ¶
func NewTransformConfig() *TransformConfig
NewTransformConfig creates a config with sensible defaults
func (*TransformConfig) Clone ¶
func (c *TransformConfig) Clone() *TransformConfig
Clone creates an independent copy of the config
func (*TransformConfig) Validate ¶
func (c *TransformConfig) Validate() error
Validate checks if config values are valid
func (*TransformConfig) WithCacheDisabled ¶
func (c *TransformConfig) WithCacheDisabled() *TransformConfig
WithCacheDisabled returns a new config with cache disabled
func (*TransformConfig) WithCacheTTL ¶
func (c *TransformConfig) WithCacheTTL(ttl time.Duration) *TransformConfig
WithCacheTTL returns a new config with updated cache TTL
func (*TransformConfig) WithMaxPayloadSize ¶
func (c *TransformConfig) WithMaxPayloadSize(size int64) *TransformConfig
WithMaxPayloadSize returns a new config with updated max payload size
func (*TransformConfig) WithMaxTransformCount ¶
func (c *TransformConfig) WithMaxTransformCount(count int) *TransformConfig
WithMaxTransformCount returns a new config with updated max transform count
func (*TransformConfig) WithTimeout ¶
func (c *TransformConfig) WithTimeout(timeout time.Duration) *TransformConfig
WithTimeout returns a new config with updated timeout
type TransformError ¶
TransformError represents transformation execution failures
func NewTransformError ¶
func NewTransformError(message string) *TransformError
NewTransformError creates a new transform error
func WrapTransformError ¶
func WrapTransformError(err error, message string) *TransformError
WrapTransformError wraps an existing error with additional context
func (*TransformError) Error ¶
func (e *TransformError) Error() string
Error implements the error interface
func (*TransformError) Unwrap ¶
func (e *TransformError) Unwrap() error
Unwrap returns the wrapped error for error chain inspection
type ValidationError ¶
type ValidationError struct {
Message string
}
ValidationError represents validation failures in transformation
func NewValidationError ¶
func NewValidationError(message string) *ValidationError
NewValidationError creates a new validation error
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface