Documentation
¶
Index ¶
- func CheckColor(field string, value string) (errs []error)
- func CheckCurrency(field string, value string) (errs []error)
- func CheckEmail(field string, value string) (errs []error)
- func CheckInArray(field string, value string, values ...string) []error
- func CheckInArrayInt(field string, value int, values ...int) []error
- func CheckInsideRange(field string, value float64, min float64, max float64) (errs []error)
- func CheckInsideRangeInt(field string, value int, min int, max int) (errs []error)
- func CheckLanguage(field string, value string) (errs []error)
- func CheckPositive(field string, value float64) (errs []error)
- func CheckPositiveInt(field string, value int) (errs []error)
- func CheckPresent(field string, value string) (errs []error)
- func CheckTimezone(field string, value string) (errs []error)
- func CheckURL(field string, value string) (errs []error)
- func IsValidColor(color string) bool
- func IsValidCurrency(value string) bool
- func IsValidEmail(email string) bool
- func IsValidLanguage(value string) bool
- func IsValidTimezone(value string) (string, bool)
- func IsValidURL(url string) bool
- func SecondsToString(secs int) string
- func StringToSeconds(value string) (int, error)
- type Date
- func (r *Date) IsZero() bool
- func (r Date) MarshalGQL(w io.Writer)
- func (r *Date) MarshalJSON() ([]byte, error)
- func (r *Date) Scan(src interface{}) error
- func (r *Date) String() string
- func (r *Date) UnmarshalGQL(src interface{}) error
- func (r *Date) UnmarshalJSON(v []byte) error
- func (r Date) Value() (driver.Value, error)
- type Float
- func (r Float) MarshalGQL(w io.Writer)
- func (r *Float) MarshalJSON() ([]byte, error)
- func (r *Float) Scan(src interface{}) error
- func (r *Float) String() string
- func (r *Float) UnmarshalGQL(v interface{}) error
- func (r *Float) UnmarshalJSON(v []byte) error
- func (r Float) Value() (driver.Value, error)
- type Geometry
- type Int
- type Ints
- type Key
- func (r *Key) Int() int
- func (r Key) MarshalGQL(w io.Writer)
- func (r *Key) MarshalJSON() ([]byte, error)
- func (r *Key) Scan(src interface{}) error
- func (r *Key) String() string
- func (r *Key) UnmarshalGQL(v interface{}) error
- func (r *Key) UnmarshalJSON(v []byte) error
- func (r Key) Value() (driver.Value, error)
- type LineString
- type Point
- type Polygon
- type RouteType
- type String
- type Strings
- type Tags
- func (r *Tags) Get(k string) (string, bool)
- func (r *Tags) Keys() []string
- func (r Tags) MarshalGQL(w io.Writer)
- func (r *Tags) MarshalJSON() ([]byte, error)
- func (r *Tags) Scan(value interface{}) error
- func (r *Tags) Set(k, v string)
- func (r *Tags) UnmarshalGQL(v interface{}) error
- func (r *Tags) UnmarshalJSON(v []byte) error
- func (r Tags) Value() (driver.Value, error)
- type Time
- type WideTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckColor ¶
CheckColor returns an error if the value is not a valid hex color
func CheckCurrency ¶
CheckCurrency returns an error if the value is not a known currency
func CheckEmail ¶
CheckEmail returns an error if the value is not a reasonably valid email address
func CheckInArray ¶
CheckInArray returns an error if the value is not in the set of provided values.
func CheckInArrayInt ¶
CheckInArrayInt returns an error if the value is not in the set of provided values.
func CheckInsideRange ¶
CheckInsideRange returns an error if the value is outside of the specified range
func CheckInsideRangeInt ¶
CheckInsideRangeInt returns an error if the value is outside of the specified range
func CheckLanguage ¶
CheckLanguage returns an error if the value is not a known language
func CheckPositive ¶
CheckPositive returns an error if the value is non-negative
func CheckPositiveInt ¶
CheckPositiveInt returns an error if the value is non-negative
func CheckPresent ¶
CheckPresent returns an error if a string is empty
func CheckTimezone ¶
CheckTimezone returns an error if the value is not a known timezone
func IsValidCurrency ¶
IsValidCurrency check is valid currency
func IsValidTimezone ¶
IsValidTimezone check is valid timezone
func SecondsToString ¶
SecondsToString takes seconds-since-midnight and returns a GTFS-style time.
func StringToSeconds ¶
StringToSeconds parses a GTFS-style time and returns seconds since midnight.
Types ¶
type Date ¶
Date is a nullable date
func (Date) MarshalGQL ¶
func (*Date) MarshalJSON ¶
func (*Date) UnmarshalGQL ¶
func (*Date) UnmarshalJSON ¶
type Float ¶
Float is a nullable float64
func (Float) MarshalGQL ¶
func (*Float) MarshalJSON ¶
func (*Float) UnmarshalGQL ¶
func (*Float) UnmarshalJSON ¶
type Geometry ¶
Geometry is an EWKB/GeoJSON wrapper for arbitary geometry.
func (Geometry) MarshalGQL ¶
func (*Geometry) MarshalJSON ¶
func (*Geometry) UnmarshalGQL ¶
type Int ¶
Int is a nullable int
func (Int) MarshalGQL ¶
func (*Int) MarshalJSON ¶
func (*Int) UnmarshalGQL ¶
func (*Int) UnmarshalJSON ¶
type Key ¶
Key is a nullable foreign key constraint, similar to sql.NullString
func (Key) MarshalGQL ¶
func (*Key) MarshalJSON ¶
func (*Key) UnmarshalGQL ¶
func (*Key) UnmarshalJSON ¶
type LineString ¶
type LineString struct { Valid bool geom.LineString }
LineString is an EWKB/SL encoded LineString
func NewLineStringFromFlatCoords ¶
func NewLineStringFromFlatCoords(coords []float64) LineString
NewLineStringFromFlatCoords returns a new LineString from flat (3) coordinates
func (LineString) MarshalGQL ¶
func (g LineString) MarshalGQL(w io.Writer)
func (*LineString) MarshalJSON ¶
func (g *LineString) MarshalJSON() ([]byte, error)
func (*LineString) Scan ¶
func (g *LineString) Scan(src interface{}) error
func (LineString) String ¶
func (g LineString) String() string
func (*LineString) UnmarshalGQL ¶
func (g *LineString) UnmarshalGQL(v interface{}) error
type Point ¶
Point is an EWKB/SL encoded point
func (Point) MarshalGQL ¶
func (*Point) MarshalJSON ¶
func (*Point) UnmarshalGQL ¶
type Polygon ¶
Polygon is an EWKB/SL encoded Polygon
func (Polygon) MarshalGQL ¶
func (*Polygon) MarshalJSON ¶
func (*Polygon) UnmarshalGQL ¶
type RouteType ¶
RouteType contains details on each possible route_type
func GetBasicRouteType ¶
GetBasicRouteType returns the closest approximate basic route_type for an extended route_type.
func GetRouteType ¶
GetRouteType returns the details for a given route_type value.
type String ¶
func (String) MarshalGQL ¶
func (*String) MarshalJSON ¶
func (*String) UnmarshalGQL ¶
func (*String) UnmarshalJSON ¶
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
Tags is a map[string]string with json and gql marshal support. This is a struct instead of bare map[string]string because of a gqlgen issue.
func (Tags) MarshalGQL ¶
func (*Tags) MarshalJSON ¶
func (*Tags) UnmarshalGQL ¶
func (*Tags) UnmarshalJSON ¶
type Time ¶
Time is a nullable date without time component
func (Time) MarshalGQL ¶
func (*Time) MarshalJSON ¶
func (*Time) UnmarshalGQL ¶
type WideTime ¶
WideTime handles seconds since midnight, allows >24 hours.
func NewWideTime ¶
NewWideTime converts the csv string to a WideTime.
func NewWideTimeFromSeconds ¶
NewWideTimeFromSeconds creates a valid WideTime from Seconds.