pgTypes

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NullPoint

type NullPoint struct {
	Valid bool
	// contains filtered or unexported fields
}

NullPoint represents an x,y coordinate in EPSG:4326 for PostGIS that supports null value

func NewNullPoint

func NewNullPoint(lat, lng float64) NullPoint

func (NullPoint) Lat

func (p NullPoint) Lat() float64

func (NullPoint) Lng

func (p NullPoint) Lng() float64

func (NullPoint) Point

func (p NullPoint) Point() Point

func (*NullPoint) Scan

func (p *NullPoint) Scan(val interface{}) error

Scan implements the sql.Scanner interface.

func (NullPoint) String

func (p NullPoint) String() string

func (NullPoint) Value

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

Value implements driver.Valuer interface

type Point

type Point [2]float64

Point represents an x,y coordinate in EPSG:4326 for PostGIS. Use type `geography(Point, 4326)` when declaring column

Reference: https://github.com/go-pg/pg/issues/829#issuecomment-505882885

func NewPoint

func NewPoint(lat, lng float64) Point

func (Point) Lat

func (p Point) Lat() float64

func (Point) Lng

func (p Point) Lng() float64

func (*Point) Scan

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

Scan implements the sql.Scanner interface.

func (Point) String

func (p Point) String() string

func (Point) Value

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

Value implements driver.Valuer interface

Jump to

Keyboard shortcuts

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