Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
ID int `json:"id"`
Name string `json:"name"`
OccurredAt time.Time `json:"occurred_at"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
Event uses time.Time and json.RawMessage.
type Nullable ¶
Nullable is a generic nullable wrapper that marshals to/from a plain JSON value (or null), rather than the struct encoding used by database/sql Null* types.
func (Nullable[T]) MarshalJSON ¶
func (*Nullable[T]) UnmarshalJSON ¶
type NullableFields ¶
type NullableFields struct {
Name Nullable[string] `json:"name"`
Age Nullable[int64] `json:"age"`
Score Nullable[float64] `json:"score"`
Active Nullable[bool] `json:"active"`
}
NullableFields uses the local Nullable[T] type so the JSON wire format is a plain scalar ("Alice", 30, …) rather than {"String":"Alice","Valid":true}.
type Page ¶
type Page[T any] struct { Items []T `json:"items"` Total int `json:"total"` PageNum int `json:"page"` PageSize int `json:"page_size"` }
Page is a generic paginated response wrapper.
Click to show internal directories.
Click to hide internal directories.