db

package
v0.0.0-...-94f9a4b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresConnector

type PostgresConnector struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
	SSL      string
}

type Storage

type Storage struct {
	DB *sqlx.DB
}

func ConnectPostgres

func ConnectPostgres(p PostgresConnector) (*Storage, error)

func ConnectSqlite

func ConnectSqlite(path string) (*Storage, error)

func (*Storage) AddPassport

func (s *Storage) AddPassport(p models.Passport) (int64, error)

func (*Storage) AllAirports

func (s *Storage) AllAirports() ([]models.AirPorts, error)

func (*Storage) AllTickets

func (s *Storage) AllTickets() ([]models.Ticket, error)

func (*Storage) CreateUser

func (s *Storage) CreateUser(u models.User) (int64, error)

func (*Storage) DeletePassport

func (s *Storage) DeletePassport(id int) error

func (*Storage) FindTickets

func (s *Storage) FindTickets(t *models.TicketsSearch) ([]models.Ticket, error)

func (*Storage) GetBuyHistory

func (s *Storage) GetBuyHistory(userID int) ([]models.BuyHistory, error)

func (*Storage) GetPassportData

func (s *Storage) GetPassportData(id int) ([]models.Passport, error)

func (*Storage) GetUser

func (s *Storage) GetUser(u models.User) (*models.User, error)

func (*Storage) MinusTicketCount

func (s *Storage) MinusTicketCount(id string, count int) error

func (*Storage) SetBuyHistory

func (s *Storage) SetBuyHistory(h models.BuyHistory) error

Jump to

Keyboard shortcuts

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