Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrorInvalidValue = errors.New("invalid []byte value")
)
Functions ¶
This section is empty.
Types ¶
type IsoDate ¶
IsoDate struct
func ParseIsoDate ¶
ParseIsoDate converts string to iso date.
It takes a string value as input. Returns IsoDate and an error.
func (IsoDate) GoString ¶
GoString returns the iso date in Go source code format string.
No parameters. Returns a string.
func (IsoDate) MarshalJSON ¶
MarshalJSON converts iso date to json string format.
No parameters. Returns a byte slice and an error.
func (IsoDate) String ¶
String returns the iso date formatted using the format string.
No parameters. Returns a string.
func (*IsoDate) UnmarshalJSON ¶
UnmarshalJSON converts json string to iso date.
It takes a byte slice as the input data. Returns an error.
type IsoTime ¶
IsoTime struct
func ParseIsoTime ¶
ParseIsoTime converts string to iso time.
It takes a string value as input. Returns IsoTime and an error.
func (IsoTime) GoString ¶
GoString returns the iso time in Go source code format string.
No parameters. Returns a string.
func (IsoTime) MarshalJSON ¶
MarshalJSON converts iso time to json string format.
No parameters. Returns a byte slice and an error.
func (IsoTime) String ¶
String returns the iso time formatted using the format string
No parameters. Returns a string.
func (*IsoTime) UnmarshalJSON ¶
UnmarshalJSON converts json string to iso time
It takes a byte slice as the input data. Returns an error.
type NullBool ¶
NullBoll for empty boolean field
func (NullBool) MarshalJSON ¶
func (*NullBool) UnmarshalJSON ¶
type NullDateTime ¶
NullDateTime for empty date/time field
func (NullDateTime) MarshalJSON ¶
func (t NullDateTime) MarshalJSON() ([]byte, error)
func (*NullDateTime) Scan ¶
func (t *NullDateTime) Scan(value any) error
func (*NullDateTime) UnmarshalJSON ¶
func (t *NullDateTime) UnmarshalJSON(data []byte) error
type NullFloat64 ¶
type NullFloat64 sql.NullFloat64
NullFloat64 for empty float field
func (NullFloat64) MarshalJSON ¶
func (t NullFloat64) MarshalJSON() ([]byte, error)
func (*NullFloat64) Scan ¶
func (t *NullFloat64) Scan(value any) error
func (*NullFloat64) UnmarshalJSON ¶
func (t *NullFloat64) UnmarshalJSON(data []byte) error
type NullInt16 ¶
NullInt16 for empty int16 field
func (NullInt16) MarshalJSON ¶
func (*NullInt16) UnmarshalJSON ¶
type NullInt32 ¶
NullInt32 for empty int32 field
func (NullInt32) MarshalJSON ¶
func (*NullInt32) UnmarshalJSON ¶
type NullInt64 ¶
NullInt64 for empty int64 field
func (NullInt64) MarshalJSON ¶
func (*NullInt64) UnmarshalJSON ¶
type NullIsoDate ¶
NullIsoDate for empty date field
func (NullIsoDate) MarshalJSON ¶
func (t NullIsoDate) MarshalJSON() ([]byte, error)
func (*NullIsoDate) Scan ¶
func (t *NullIsoDate) Scan(value any) error
func (*NullIsoDate) UnmarshalJSON ¶
func (t *NullIsoDate) UnmarshalJSON(data []byte) error
type NullIsoTime ¶
NullIsoTime for empty time field
func (NullIsoTime) MarshalJSON ¶
func (t NullIsoTime) MarshalJSON() ([]byte, error)
func (*NullIsoTime) Scan ¶
func (t *NullIsoTime) Scan(value any) error
func (*NullIsoTime) UnmarshalJSON ¶
func (t *NullIsoTime) UnmarshalJSON(data []byte) error
type NullString ¶
type NullString sql.NullString
NullString for empty string field
func (NullString) MarshalJSON ¶
func (t NullString) MarshalJSON() ([]byte, error)
func (*NullString) Scan ¶
func (t *NullString) Scan(value any) error
func (*NullString) UnmarshalJSON ¶
func (t *NullString) UnmarshalJSON(data []byte) error
type Page ¶
type Page[T any] struct { Content []T `json:"content"` TotalElements uint64 `json:"totalElements"` }
Page is the page response contract
type PageRequest ¶
PageRequest is the contract of request page
func NewPageRequest ¶
func NewPageRequest(page uint16, size uint16, order []Sort) *PageRequest
NewPageRequest returns a new page request pointer
func (*PageRequest) GetOrder ¶
func (p *PageRequest) GetOrder() string
GetOrder returns string contains concated order list
type Sort ¶
type Sort struct {
Direction SortDirection
Field string
}
Sort is the contract to sort an field
type SortDirection ¶
type SortDirection string
SortDirection is the field sort direction
const ( ASC SortDirection = "ASC" DESC SortDirection = "DESC" )
func (SortDirection) IsValid ¶
func (sd SortDirection) IsValid() bool
IsValid checks if the SortDirection is valid. It returns true if the SortDirection is valid, otherwise false.