store

package
v0.0.0-...-e4486b3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookSeatParams

type BookSeatParams struct {
	PassengerID int32 `db:"passenger_id" json:"passenger_id"`
	Identifier  int32 `db:"id" json:"id"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetSeatWithExclusiveLockRow

type GetSeatWithExclusiveLockRow struct {
	Identifier int32  `db:"id" json:"id"`
	SeatID     string `db:"seat_id" json:"seat_id"`
}

type GetSeatWithExclusiveLockSkippedRow

type GetSeatWithExclusiveLockSkippedRow struct {
	Identifier int32  `db:"id" json:"id"`
	SeatID     string `db:"seat_id" json:"seat_id"`
}

type GetSeatWithNoLockRow

type GetSeatWithNoLockRow struct {
	Identifier int32  `db:"id" json:"id"`
	SeatID     string `db:"seat_id" json:"seat_id"`
}

type GetSeatWithSharedLockRow

type GetSeatWithSharedLockRow struct {
	Identifier int32  `db:"id" json:"id"`
	SeatID     string `db:"seat_id" json:"seat_id"`
}

type GetSeatWithSharedLockSkippedRow

type GetSeatWithSharedLockSkippedRow struct {
	Identifier int32  `db:"id" json:"id"`
	SeatID     string `db:"seat_id" json:"seat_id"`
}

type GetTripSeatsRow

type GetTripSeatsRow struct {
	SeatID      string `db:"seat_id" json:"seat_id"`
	PassengerID int32  `db:"passenger_id" json:"passenger_id"`
}

type Passenger

type Passenger struct {
	Identifier int32  `db:"id" json:"id"`
	Name       string `db:"name" json:"name"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BookSeat

func (q *Queries) BookSeat(ctx context.Context, arg BookSeatParams) (int32, error)

func (*Queries) GetNextAvailableTrip

func (q *Queries) GetNextAvailableTrip(ctx context.Context) (int32, error)

func (*Queries) GetPassengers

func (q *Queries) GetPassengers(ctx context.Context) ([]Passenger, error)

func (*Queries) GetSeatWithExclusiveLock

func (q *Queries) GetSeatWithExclusiveLock(ctx context.Context, tripID int32) (GetSeatWithExclusiveLockRow, error)

func (*Queries) GetSeatWithExclusiveLockSkipped

func (q *Queries) GetSeatWithExclusiveLockSkipped(ctx context.Context, tripID int32) (GetSeatWithExclusiveLockSkippedRow, error)

func (*Queries) GetSeatWithNoLock

func (q *Queries) GetSeatWithNoLock(ctx context.Context, tripID int32) (GetSeatWithNoLockRow, error)

func (*Queries) GetSeatWithSharedLock

func (q *Queries) GetSeatWithSharedLock(ctx context.Context, tripID int32) (GetSeatWithSharedLockRow, error)

func (*Queries) GetSeatWithSharedLockSkipped

func (q *Queries) GetSeatWithSharedLockSkipped(ctx context.Context, tripID int32) (GetSeatWithSharedLockSkippedRow, error)

func (*Queries) GetTripSeats

func (q *Queries) GetTripSeats(ctx context.Context, tripID int32) ([]GetTripSeatsRow, error)

func (*Queries) MarkTripForBooking

func (q *Queries) MarkTripForBooking(ctx context.Context, id int32) (int32, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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