Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) GetChangeType ¶
func (*Entry) GetItemType ¶
type List ¶
type List[T comparable] struct { // contains filtered or unexported fields }
List is a generic type used to track changes in a model. T must conform to the comparable constraint to ensure consistent behaviour with map keys.
func NewChanges ¶
func NewChanges[T comparable]() List[T]
func (*List[T]) ClearChanges ¶
func (b *List[T]) ClearChanges()
ClearChanges removes all tracked changes by resetting the internal map to an empty state. This method is only supposed to be called by the repository implementations.
func (*List[T]) GetChanges ¶
func (b *List[T]) GetChanges() []T
GetChanges returns a slice of all tracked changes in the Changes collection.
func (*List[T]) HasChanges ¶
HasChanges checks if any changes have been tracked in the Changes collection. Returns true if there are tracked changes, false otherwise.
func (*List[T]) TrackChange ¶
func (b *List[T]) TrackChange(key T)
TrackChange adds the given key to the changes map to indicate a modification of the corresponding property.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
func NewTracker ¶
func NewTracker() *Tracker