convert

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package convert contains type converters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertCause

func AlertCause(cause string) api.Alert_Cause

func AlertEffect

func AlertEffect(effect string) api.Alert_Effect

func AlertText

func AlertText(s string) []*api.Alert_Text

func ApiCongestionLevel

func ApiCongestionLevel(t string) api.Vehicle_CongestionLevel

func ApiShape added in v0.6.1

func ApiShape(shape *gtfs.Shape) *api.Shape

func BikesAllowed added in v0.6.1

func BikesAllowed(bikesAllowed gtfs.BikesAllowed) pgtype.Bool

func Bool added in v0.6.1

func Bool(b bool) pgtype.Bool

func CongestionLevel

func CongestionLevel(congestionLevel gtfs.CongestionLevel) string

func ContinuousPolicy

func ContinuousPolicy(p string) api.Route_ContinuousPolicy

func Date added in v0.6.1

func Date(t time.Time) pgtype.Date

func DirectionID

func DirectionID(d gtfs.DirectionID) pgtype.Bool

func Duration added in v0.6.1

func Duration(d time.Duration) pgtype.Int4

func ExactTimesToIsFrequencyBased added in v0.6.1

func ExactTimesToIsFrequencyBased(exactTime gtfs.ExactTimes) bool

func FeedUpdateStatus

func FeedUpdateStatus(logger *slog.Logger, result pgtype.Text) *api.FeedUpdate_Status

func Gps

func Gps[T float32 | float64](longitude, latitude *T) types.Geography

func GtfsRealtimeExtension

func GtfsRealtimeExtension(in *api.GtfsRealtimeOptions) (extensions.Extension, error)

func JSONShapeToApiShape added in v0.6.1

func JSONShapeToApiShape(bytes []byte) (*api.Shape, error)

func NullApiCurrentStatus

func NullApiCurrentStatus(t pgtype.Text) *api.Vehicle_CurrentStatus

func NullApiOccupancyStatus

func NullApiOccupancyStatus(t pgtype.Text) *api.Vehicle_OccupancyStatus

func NullBool

func NullBool(t *bool) pgtype.Bool

func NullCongestionLevel

func NullCongestionLevel(congestionLevel *gtfs.CongestionLevel) string

func NullDuration

func NullDuration(d *time.Duration) pgtype.Int4

func NullFloat32

func NullFloat32(t *float32) pgtype.Float4

func NullFloat64

func NullFloat64(t *float64) pgtype.Float8

func NullIfEmptyString

func NullIfEmptyString(t string) pgtype.Text

func NullInt32

func NullInt32(t *int32) pgtype.Int4

func NullInt64

func NullInt64(t *int64) pgtype.Int8

func NullOccupancyStatus

func NullOccupancyStatus(occupancyStatus *gtfs.OccupancyStatus) pgtype.Text

func NullString

func NullString(t *string) pgtype.Text

func NullTime

func NullTime(t *time.Time) pgtype.Timestamptz

func NullUInt32ToSigned

func NullUInt32ToSigned(t *uint32) pgtype.Int4

func NullVehicleCurrentStatus

func NullVehicleCurrentStatus(currentStatus *gtfs.CurrentStatus) pgtype.Text

func RouteType

func RouteType(t string) api.Route_Type

func SQLGps

func SQLGps(n pgtype.Numeric) *float64

func SQLNullBool

func SQLNullBool(t pgtype.Bool) *bool

func SQLNullFloat4

func SQLNullFloat4(t pgtype.Float4) *float32

func SQLNullFloat64

func SQLNullFloat64(t sql.NullFloat64) *float64

func SQLNullFloat8

func SQLNullFloat8(t pgtype.Float8) *float64

func SQLNullInt32

func SQLNullInt32(t pgtype.Int4) *int32

func SQLNullInt64

func SQLNullInt64(t pgtype.Int8) *int64

func SQLNullString

func SQLNullString(t pgtype.Text) *string

func SQLNullTime

func SQLNullTime(t pgtype.Timestamptz) *int64

func SQLNullTimeMs

func SQLNullTimeMs(t pgtype.Timestamptz) *int64

func StopType

func StopType(t string) api.Stop_Type

func Time added in v0.6.1

func Time(duration time.Duration) pgtype.Time

func TransferType

func TransferType(t string) api.Transfer_Type

func UnmarshalJSONAndDiscardUnknown added in v0.6.1

func UnmarshalJSONAndDiscardUnknown(b []byte, m proto.Message) error

func WheelchairAccessible added in v0.6.1

func WheelchairAccessible(wheelchairBoarding gtfs.WheelchairBoarding) pgtype.Bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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