repository

package
v0.0.0-...-95589b7 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookingRepository

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

func NewBookingRepository

func NewBookingRepository(db DBConn) *BookingRepository

func (*BookingRepository) CreateBooking

func (r *BookingRepository) CreateBooking(ctx context.Context, booking *models.Booking) (*models.Booking, error)

func (*BookingRepository) DeleteBooking

func (r *BookingRepository) DeleteBooking(ctx context.Context, id string) error

func (*BookingRepository) GetBookingByID

func (r *BookingRepository) GetBookingByID(ctx context.Context, id string) (*models.Booking, error)

func (*BookingRepository) GetBookingsPaginated

func (r *BookingRepository) GetBookingsPaginated(ctx context.Context, afterCursor string, limit int) ([]models.Booking, string, error)

func (*BookingRepository) GetDestinationById

func (r *BookingRepository) GetDestinationById(ctx context.Context, id string) (*models.Destination, error)

func (*BookingRepository) GetFlights

func (r *BookingRepository) GetFlights(ctx context.Context, filters map[string]interface{}) ([]models.Flight, error)

func (*BookingRepository) IsLaunchPadWeekAvailable

func (r *BookingRepository) IsLaunchPadWeekAvailable(ctx context.Context, launchpadId, destinationId string,
	t time.Time) (bool, error)

type DBConn

type DBConn interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}

Jump to

Keyboard shortcuts

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