trips

package
v0.0.0-...-651d898 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessType

type AccessType string
const (
	AccessTypeInheritOrNoInfo AccessType = "InheritOrNoInfo"
	AccessTypeAccessPossible  AccessType = "AccessPossible"
	AccessTypeNoAccess        AccessType = "NoAccess"
)

func (*AccessType) Scan

func (e *AccessType) Scan(src interface{}) error

type CreateTripParams

type CreateTripParams struct {
	RouteID              string         `db:"route_id"`
	ServiceID            string         `db:"service_id"`
	TripID               string         `db:"trip_id"`
	TripHeadsign         string         `db:"trip_headsign"`
	TripShortName        string         `db:"trip_short_name"`
	DirectionID          TripDirection  `db:"direction_id"`
	BlockID              int32          `db:"block_id"`
	ShapeID              sql.NullString `db:"shape_id"`
	WheelchairAccessible AccessType     `db:"wheelchair_accessible"`
	BikesAllowed         AccessType     `db:"bikes_allowed"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type NullAccessType

type NullAccessType struct {
	AccessType AccessType
	Valid      bool // Valid is true if AccessType is not NULL
}

func (*NullAccessType) Scan

func (ns *NullAccessType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAccessType) Value

func (ns NullAccessType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTripDirection

type NullTripDirection struct {
	TripDirection TripDirection
	Valid         bool // Valid is true if TripDirection is not NULL
}

func (*NullTripDirection) Scan

func (ns *NullTripDirection) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTripDirection) Value

func (ns NullTripDirection) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateTrip

func (q *Queries) CreateTrip(ctx context.Context, arg CreateTripParams) error

func (*Queries) GetTripByID

func (q *Queries) GetTripByID(ctx context.Context, tripID string) (Trip, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Trip

type Trip struct {
	RouteID              string         `csv:"route_id"`
	ServiceID            string         `csv:"service_id"`
	TripID               string         `csv:"trip_id"`
	TripHeadsign         string         `csv:"trip_headsign"`
	TripShortName        string         `csv:"trip_short_name"`
	DirectionID          TripDirection  `csv:"direction_id"`
	BlockID              int32          `csv:"block_id"`
	ShapeID              sql.NullString `csv:"shape_id,omitempty"`
	WheelchairAccessible AccessType     `csv:"wheelchair_accessible"`
	BikesAllowed         AccessType     `csv:"bikes_allowed"`
}

type TripDirection

type TripDirection string
const (
	TripDirectionOutbound TripDirection = "Outbound"
	TripDirectionInbound  TripDirection = "Inbound"
)

func (*TripDirection) Scan

func (e *TripDirection) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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