Documentation
¶
Index ¶
- type BaseResponse
- type Dropdown
- type Field
- type GetDropdownRequest
- type GetDropdownResponse
- type GetFormRequest
- type GetFormResponse
- type GetGridRequest
- type GetGridResponse
- type GridSearch
- type GridSort
- type RemoveGridRequest
- type ReorderGridRequest
- type ReorderManyGridRequest
- type SaveFormRequest
- type SaveFormResponse
- type SaveGridRequest
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct {
Status Status `json:"status"`
Message string `json:"message,omitempty"`
}
func NewErrorResponse ¶
func NewErrorResponse(message string) BaseResponse
func NewSuccessResponse ¶
func NewSuccessResponse() BaseResponse
func (BaseResponse) Write ¶ added in v0.2.0
func (res BaseResponse) Write(w http.ResponseWriter, statusCode int) error
type Dropdown ¶ added in v0.2.9
func (*Dropdown) UnmarshalJSON ¶ added in v0.2.9
type Field ¶ added in v0.2.9
Field wraps sql.Null[T] and tracks whether the value was explicitly provided (e.g., via JSON or SQL).
func NewField ¶ added in v0.2.9
NewField creates a new Field[T] with a given value, marked as valid and provided.
func (Field[T]) IsZero ¶ added in v0.2.9
IsZero implements the json.Zeroed interface. Ensures proper marshalling of Field values, skipping non-provided values with omitzero tag.
func (Field[T]) MarshalJSON ¶ added in v0.2.9
MarshalJSON implements the json.Marshaler interface. Ensures proper marshalling of Field values, representing unset values as null.
func (*Field[T]) Scan ¶ added in v0.2.9
Scan implements the sql.Scanner interface for Field. Ensures that Provided flag is set.
func (*Field[T]) UnmarshalJSON ¶ added in v0.2.9
UnmarshalJSON implements the json.Unmarshaler interface. Ensures proper unmarshalling of JSON data, setting the Valid flag based on the JSON data.
type GetDropdownRequest ¶ added in v0.2.11
func ParseGetDropdownRequest ¶ added in v0.2.11
func ParseGetDropdownRequest(request string) (GetDropdownRequest, error)
type GetDropdownResponse ¶ added in v0.2.11
type GetDropdownResponse[T any] struct { Status Status `json:"status"` Records []T `json:"records"` }
func NewGetDropdownResponse ¶ added in v0.2.11
func NewGetDropdownResponse[T any](records []T) GetDropdownResponse[T]
func (GetDropdownResponse[T]) Write ¶ added in v0.2.11
func (res GetDropdownResponse[T]) Write(w http.ResponseWriter) error
type GetFormRequest ¶ added in v0.2.11
type GetFormRequest struct {
Action string `json:"action"`
Name string `json:"name"`
RecID int `json:"recid"`
}
func ParseGetFormRequest ¶ added in v0.2.11
func ParseGetFormRequest(request string) (GetFormRequest, error)
type GetFormResponse ¶ added in v0.2.11
type GetFormResponse[T any] struct { Status Status `json:"status"` Record *T `json:"record,omitempty"` }
func NewGetFormResponse ¶ added in v0.2.11
func NewGetFormResponse[T any](record T) GetFormResponse[T]
func (GetFormResponse[T]) Write ¶ added in v0.2.11
func (res GetFormResponse[T]) Write(w http.ResponseWriter) error
type GetGridRequest ¶ added in v0.2.11
type GetGridRequest struct {
Limit int `json:"limit"`
Offset int `json:"offset"`
SearchLogic string `json:"searchLogic"`
Search []GridSearch `json:"search"`
Sort []GridSort `json:"sort"`
}
func ParseGetGridRequest ¶ added in v0.2.11
func ParseGetGridRequest(request string) (GetGridRequest, error)
type GetGridResponse ¶ added in v0.2.11
type GetGridResponse[T any] struct { Status Status `json:"status"` Records []T `json:"records,omitempty"` Summary []T `json:"summary,omitempty"` Total int `json:"total,omitempty"` }
func NewGetGridResponse ¶ added in v0.2.11
func NewGetGridResponse[T any](records []T, total int) GetGridResponse[T]
func NewGetGridResponseWithSummary ¶ added in v0.2.11
func NewGetGridResponseWithSummary[T any](records []T, summary []T, total int) GetGridResponse[T]
func (GetGridResponse[T]) Write ¶ added in v0.2.11
func (res GetGridResponse[T]) Write(w http.ResponseWriter) error
type GridSearch ¶
type RemoveGridRequest ¶ added in v0.2.11
type RemoveGridRequest struct {
ID []int `json:"id"`
}
func ParseRemoveGridRequest ¶ added in v0.2.11
func ParseRemoveGridRequest(body io.Reader) (RemoveGridRequest, error)
type ReorderGridRequest ¶ added in v0.2.11
func ParseReorderGridRequest ¶ added in v0.2.11
func ParseReorderGridRequest(body io.Reader) (ReorderGridRequest, error)
func (ReorderGridRequest) MarshalJSON ¶ added in v0.2.11
func (req ReorderGridRequest) MarshalJSON() ([]byte, error)
func (*ReorderGridRequest) UnmarshalJSON ¶ added in v0.2.11
func (req *ReorderGridRequest) UnmarshalJSON(data []byte) error
type ReorderManyGridRequest ¶ added in v0.2.11
func ParseReorderManyGridRequest ¶ added in v0.2.11
func ParseReorderManyGridRequest(body io.Reader) (ReorderManyGridRequest, error)
func (ReorderManyGridRequest) MarshalJSON ¶ added in v0.2.11
func (req ReorderManyGridRequest) MarshalJSON() ([]byte, error)
func (*ReorderManyGridRequest) UnmarshalJSON ¶ added in v0.2.11
func (req *ReorderManyGridRequest) UnmarshalJSON(data []byte) error
type SaveFormRequest ¶ added in v0.2.11
type SaveFormRequest[T any] struct { Action string `json:"action"` Name string `json:"name"` RecID int `json:"recid"` Record T `json:"record"` }
func ParseSaveFormRequest ¶ added in v0.2.11
func ParseSaveFormRequest[T any](body io.Reader) (SaveFormRequest[T], error)
type SaveFormResponse ¶ added in v0.2.11
func NewSaveFormResponse ¶ added in v0.2.11
func NewSaveFormResponse(recID int) SaveFormResponse
func (SaveFormResponse) Write ¶ added in v0.2.11
func (res SaveFormResponse) Write(w http.ResponseWriter) error
type SaveGridRequest ¶ added in v0.2.11
type SaveGridRequest[T any] struct { Changes []T `json:"changes"` }
func ParseSaveGridRequest ¶ added in v0.2.11
func ParseSaveGridRequest[T any](body io.Reader) (SaveGridRequest[T], error)