Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slice ¶
type Slice[T comparable] struct { Values []T `json:"values" bson:"values"` Added []T `json:"-" bson:"-"` Deleted []T `json:"-" bson:"-"` }
Slice tracks changes to a slice of generic values. As items are added or removed from the slice, they are tracked in the "Added" and "Deleted" lists.
func NewSlice ¶
func NewSlice[T comparable](values ...T) Slice[T]
NewSlice returns a fully initialized Slice object
func (Slice[T]) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface and serializes the Slice into a JSON array
func (*Slice[T]) SetValue ¶
SetValue implements schema.ValueSetter and updates the current value, tracking changes to the added and deleted lists.
func (*Slice[T]) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface and deserializes the Slice from a JSON array
Click to show internal directories.
Click to hide internal directories.