godatatype

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

godatatype

Useful data types that implement interfaces for compatibility with various packages

Documentation

Index

Constants

View Source
const DateTimeFormat = "2006-01-02T15:04"
View Source
const TimeOfDayFormat = "15:04"
View Source
const TimeOfDayFormatExtended = "15:04:05"

Variables

This section is empty.

Functions

This section is empty.

Types

type DateTime

type DateTime struct {
	sql.NullTime
}

func (DateTime) GormDataType

func (d DateTime) GormDataType() string

func (DateTime) MarshalGQL

func (d DateTime) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) UnmarshalGQL

func (d *DateTime) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(data []byte) error

func (DateTime) Value

func (d DateTime) Value() (driver.Value, error)

type Duration

type Duration struct {
	Duration time.Duration
	Valid    bool
}

func (Duration) GormDataType

func (Duration) GormDataType() string

func (Duration) MarshalGQL

func (d Duration) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) Scan

func (d *Duration) Scan(value any) error

func (*Duration) UnmarshalGQL

func (d *Duration) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

func (Duration) Value

func (d Duration) Value() (driver.Value, error)

type LatLng

type LatLng struct {
	Lat float64
	Lng float64
}

type Point

type Point struct {
	Point *wkb.Point
}

func (Point) GormDataType

func (p Point) GormDataType() string

func (Point) LatLng

func (p Point) LatLng() *LatLng

func (*Point) Scan

func (p *Point) Scan(src interface{}) error

func (*Point) SetCoordinates

func (p *Point) SetCoordinates(lat, lng float64)

Set point as Latitude and Longitude coordinates.

func (Point) Value

func (p Point) Value() (driver.Value, error)

type TimeOfDay

type TimeOfDay struct {
	sql.NullTime
}

func (TimeOfDay) GormDataType

func (TimeOfDay) GormDataType() string

func (TimeOfDay) MarshalGQL

func (t TimeOfDay) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (TimeOfDay) MarshalJSON

func (t TimeOfDay) MarshalJSON() ([]byte, error)

func (*TimeOfDay) Scan

func (t *TimeOfDay) Scan(value any) error

func (*TimeOfDay) UnmarshalGQL

func (t *TimeOfDay) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*TimeOfDay) UnmarshalJSON

func (t *TimeOfDay) UnmarshalJSON(data []byte) error

func (TimeOfDay) Value

func (t TimeOfDay) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址