Documentation
¶
Index ¶
- type DateTime
- func (t DateTime) AddDate(years int, months int, days int) DateTime
- func (t DateTime) After(u DateTime) bool
- func (t DateTime) Before(u DateTime) bool
- func (t DateTime) Equal(u DateTime) bool
- func (t DateTime) FromTime(u time.Time) DateTime
- func (t DateTime) GoString() string
- func (t DateTime) MarshalJSON() ([]byte, error)
- func (t DateTime) Now() DateTime
- func (t DateTime) String() string
- func (t DateTime) Time() time.Time
- func (t *DateTime) UnmarshalJSON(data []byte) error
- func (t DateTime) Value() (driver.Value, error)
- type IsoDate
- func (i IsoDate) AddDate(years int, months int, days int) IsoDate
- func (i IsoDate) After(i2 IsoDate) bool
- func (i IsoDate) Before(i2 IsoDate) bool
- func (i IsoDate) Compare(i2 IsoDate) int
- func (i IsoDate) Equal(i2 IsoDate) bool
- func (i IsoDate) FromDateTime(t DateTime) IsoDate
- func (i IsoDate) FromTime(t time.Time) IsoDate
- func (t IsoDate) GoString() string
- func (i IsoDate) IsZero() bool
- func (t IsoDate) MarshalJSON() ([]byte, error)
- func (t IsoDate) String() string
- func (i IsoDate) Time() time.Time
- func (t *IsoDate) UnmarshalJSON(data []byte) error
- func (t IsoDate) Value() (driver.Value, error)
- type IsoTime
- type JsonB
- type Monetary
- func (m Monetary) Add(value Monetary) Monetary
- func (m Monetary) Cents() int64
- func (m Monetary) Compare(value Monetary) int
- func (m Monetary) Div(value Monetary) Monetary
- func (m Monetary) Equal(value Monetary) bool
- func (m Monetary) GreaterThanOrEqual(value Monetary) bool
- func (m Monetary) LessThanOrEqual(value Monetary) bool
- func (m Monetary) MarshalJSON() ([]byte, error)
- func (m Monetary) Mul(value Monetary) Monetary
- func (m Monetary) Sub(value Monetary) Monetary
- func (m *Monetary) UnmarshalJSON(data []byte) error
- func (m Monetary) Value() (driver.Value, error)
- type NullBool
- type NullDateTime
- type NullFloat64
- type NullInt16
- type NullInt32
- type NullInt64
- type NullIsoDate
- type NullIsoTime
- type NullJsonB
- type NullString
- type Page
- type PageRequest
- type Sort
- type SortDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateTime ¶ added in v0.1.5
DateTime for empty date/time field
func ParseDateTime ¶ added in v0.1.5
ParseDateTime converts string to date time
func (DateTime) Before ¶ added in v0.1.5
Before checks if the date time is before the given date time
func (DateTime) Equal ¶ added in v0.1.5
Equal checks if the date time is equal to the given date time
func (DateTime) GoString ¶ added in v0.1.5
GoString returns the iso date time in Go source code format string
func (DateTime) MarshalJSON ¶ added in v0.1.5
MarshalJSON converts iso date time to json string format
func (DateTime) String ¶ added in v0.1.5
String returns the iso date time formatted using the format string
func (*DateTime) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON converts json string to iso date time
type IsoDate ¶
IsoDate struct
func MustParseIsoDate ¶ added in v0.1.5
MustParseIsoDate converts string to iso date and panics if error occurs
func ParseIsoDate ¶
ParseIsoDate converts string to iso date
func (IsoDate) FromDateTime ¶ added in v0.1.5
FromDateTime converts DateTime to iso date
func (IsoDate) MarshalJSON ¶
MarshalJSON converts iso date to json string format
func (*IsoDate) UnmarshalJSON ¶
UnmarshalJSON converts json string to iso date
type IsoTime ¶
IsoTime struct
func ParseIsoTime ¶
ParseIsoTime converts string to iso time
func (IsoTime) MarshalJSON ¶
MarshalJSON converts iso time to json string format
func (*IsoTime) UnmarshalJSON ¶
UnmarshalJSON converts json string to iso time
type Monetary ¶ added in v0.1.5
Monetary for value field
func NewMonetaryFromCents ¶ added in v0.1.5
NewMonetaryFromCents creates a new Monetary from an integer cent value
func NewMonetaryFromDecimal ¶ added in v0.1.5
NewMonetaryFromDecimal creates a new Monetary from a decimal.Decimal
func NewMonetaryFromFloat ¶ added in v0.1.5
NewMonetaryFromFloat creates a new Monetary from a float64
func ParseMonetary ¶ added in v0.1.5
ParseMonetary converts string to monetary
func (Monetary) Add ¶ added in v0.1.5
Add creates a new Monetary by adding incoming value to current value
func (Monetary) Div ¶ added in v0.1.5
Div creates a new Monetary by dividing current value by incoming value
func (Monetary) GreaterThanOrEqual ¶ added in v0.1.5
GreaterThanOrEqual checks if current value is greater than or equal to incoming value
func (Monetary) LessThanOrEqual ¶ added in v0.1.5
LessThanOrEqual checks if current value is less than or equal to incoming value
func (Monetary) MarshalJSON ¶ added in v0.1.5
MarshalJSON converts the Monetary value to a JSON string format
func (Monetary) Mul ¶ added in v0.1.5
Mul creates a new Monetary by multiplying current value with incoming value
func (Monetary) Sub ¶ added in v0.1.5
Sub creates a new Monetary by subtracting incoming value from current value
func (*Monetary) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON converts a JSON string or float to a Monetary value
type NullBool ¶
NullBoll for empty boolean field
func ParseNullBool ¶ added in v0.1.5
ParseNullBool converts string to NullBool
func (NullBool) MarshalJSON ¶
MarshalJSON converts null bool to json bool format
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON converts json bool to null bool
type NullDateTime ¶
NullDateTime for empty date/time field
func ParseNullDateTime ¶ added in v0.1.5
func ParseNullDateTime(value string) (NullDateTime, error)
ParseNullDateTime converts string to NullDateTime
func (NullDateTime) MarshalJSON ¶
func (t NullDateTime) MarshalJSON() ([]byte, error)
MarshalJSON converts null date time to json date time format
func (*NullDateTime) Scan ¶
func (t *NullDateTime) Scan(value any) error
Scan converts sql driver value to null date time
func (*NullDateTime) UnmarshalJSON ¶
func (t *NullDateTime) UnmarshalJSON(data []byte) error
UnmarshalJSON converts json date time to null date time
type NullFloat64 ¶
type NullFloat64 sql.NullFloat64
NullFloat64 for empty float field
func ParseNullFloat64 ¶ added in v0.1.5
func ParseNullFloat64(value string) (NullFloat64, error)
ParseNullFloat64 converts string to NullFloat64
func (NullFloat64) MarshalJSON ¶
func (t NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON converts null float64 to json float64 format
func (*NullFloat64) Scan ¶
func (t *NullFloat64) Scan(value any) error
Scan converts sql driver value to null float64
func (*NullFloat64) UnmarshalJSON ¶
func (t *NullFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON converts json float64 to null float64
type NullInt16 ¶
NullInt16 for empty int16 field
func ParseNullInt16 ¶ added in v0.1.5
ParseNullInt16 converts string to NullInt16
func (NullInt16) MarshalJSON ¶
MarshalJSON converts null int16 to json int16 format
func (*NullInt16) UnmarshalJSON ¶
UnmarshalJSON converts json int16 to null int16
type NullInt32 ¶
NullInt32 for empty int32 field
func ParseNullInt32 ¶ added in v0.1.5
ParseNullInt32 converts string to int32
func (NullInt32) MarshalJSON ¶
MarshalJSON converts null int32 to json int32 format
func (*NullInt32) UnmarshalJSON ¶
UnmarshalJSON converts json int32 to null int32
type NullInt64 ¶
NullInt64 for empty int64 field
func ParseNullInt64 ¶ added in v0.1.5
ParseNullInt64 converts string to int64
func (NullInt64) MarshalJSON ¶
MarshalJSON converts null int64 to json int64 format
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON converts json int64 to null int64
type NullIsoDate ¶
NullIsoDate for empty date field
func ParseNullIsoDate ¶ added in v0.1.5
func ParseNullIsoDate(value string) (NullIsoDate, error)
ParseNullIsoDate converts string to NullIsoDate
func (NullIsoDate) MarshalJSON ¶
func (t NullIsoDate) MarshalJSON() ([]byte, error)
MarshalJSON converts null iso date to json iso date format
func (*NullIsoDate) Scan ¶
func (t *NullIsoDate) Scan(value any) error
Scan converts sql driver value to null iso date
func (*NullIsoDate) UnmarshalJSON ¶
func (t *NullIsoDate) UnmarshalJSON(data []byte) error
UnmarshalJSON converts json iso date to null iso date
type NullIsoTime ¶
NullIsoTime for empty time field
func ParseNullIsoTime ¶ added in v0.1.5
func ParseNullIsoTime(value string) (NullIsoTime, error)
ParseNullIsoTime converts string to NullIsoTime
func (NullIsoTime) MarshalJSON ¶
func (t NullIsoTime) MarshalJSON() ([]byte, error)
MarshalJSON converts null iso time to json iso time format
func (*NullIsoTime) Scan ¶
func (t *NullIsoTime) Scan(value any) error
Scan converts sql driver value to null iso time
func (*NullIsoTime) UnmarshalJSON ¶
func (t *NullIsoTime) UnmarshalJSON(data []byte) error
UnmarshalJSON converts json iso time to null iso time
type NullJsonB ¶ added in v0.1.5
NullJsonB for empty jsonb field
type NullString ¶
type NullString sql.NullString
NullString for empty string field
func (NullString) MarshalJSON ¶
func (t NullString) MarshalJSON() ([]byte, error)
MarshalJSON converts null string to json string format
func (*NullString) Scan ¶
func (t *NullString) Scan(value any) error
Scan converts sql driver value to null string
func (*NullString) UnmarshalJSON ¶
func (t *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON converts json string to null string
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 a 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.