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[T int | int64](field string, value T, values ...T) []error
- func CheckInsideRange(field string, value float64, min float64, max float64) (errs []error)
- func CheckInsideRangeInt[T int | int64](field string, value T, min T, max T) (errs []error)
- func CheckLanguage(field string, value string) (errs []error)
- func CheckPositive(field string, value float64) (errs []error)
- func CheckPositiveInt[T int | int64](field string, value T) (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 Bool
- type CurrencyAmount
- type Date
- func (r *Date) After(other Date) bool
- func (r *Date) Before(other Date) bool
- 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
- type LineString
- type Option
- 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
- func (r *Time) IsZero() bool
- func (r Time) MarshalGQL(w io.Writer)
- func (r Time) MarshalJSON() ([]byte, error)
- func (r *Time) Scan(src interface{}) error
- func (r *Time) String() string
- func (r *Time) UnmarshalGQL(v interface{}) error
- func (r *Time) UnmarshalJSON(v []byte) error
- func (r Time) Value() (driver.Value, error)
- type WideTime
- func (wt *WideTime) FromCsv(v string) error
- func (wt WideTime) MarshalGQL(w io.Writer)
- func (wt *WideTime) Scan(src interface{}) error
- func (wt *WideTime) String() string
- func (wt *WideTime) ToCsv() string
- func (wt *WideTime) UnmarshalGQL(v interface{}) error
- func (wt WideTime) Value() (driver.Value, error)
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 Bool ¶ added in v0.12.0
func (Bool) MarshalGQL ¶ added in v0.12.0
func (*Bool) MarshalJSON ¶ added in v0.12.0
func (*Bool) UnmarshalGQL ¶ added in v0.12.0
func (*Bool) UnmarshalJSON ¶ added in v0.12.0
type CurrencyAmount ¶ added in v0.13.0
func NewCurrencyAmount ¶ added in v0.13.0
func NewCurrencyAmount(v float64) CurrencyAmount
func (*CurrencyAmount) SetCurrency ¶ added in v0.13.0
func (r *CurrencyAmount) SetCurrency(value string) error
func (CurrencyAmount) ToCsv ¶ added in v0.13.0
func (r CurrencyAmount) ToCsv() string
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 Key ¶
Key is a nullable foreign key constraint, similar to sql.NullString
func (*Key) UnmarshalGQL ¶
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 Option ¶ added in v0.13.0
func (Option[T]) MarshalJSON ¶ added in v0.13.0
func (*Option[T]) UnmarshalJSON ¶ added in v0.13.0
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 Strings ¶
type Strings []String
Strings helps read and write []String as JSON
func (Strings) MarshalGQL ¶ added in v0.12.0
func (Strings) MarshalJSON ¶ added in v0.12.0
func (*Strings) UnmarshalGQL ¶ added in v0.12.0
func (*Strings) UnmarshalJSON ¶ added in v0.12.0
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 ¶
func (*Time) UnmarshalJSON ¶ added in v0.12.0
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.