Documentation ¶
Index ¶
- type City
- type CityTour
- type CityTourData
- type CityTourTicketData
- type CityTourTicketIdData
- type CityToursEvent
- type CityToursRestBooking
- type Event
- type EventData
- type EventFeedItem
- type EventsFilterParameters
- type Hotel
- type HotelData
- type HotelFeedItem
- type HotelFilterParameters
- type PostgresRepository
- func (db PostgresRepository) CreateCityTour(cityTour *CityTour) error
- func (db PostgresRepository) CreateCityTourEvent(cityTourEvent *CityToursEvent) error
- func (db PostgresRepository) CreateRestaurantBooking(restaurantBooking *RestaurantBookingDTO) error
- func (db PostgresRepository) CreateTour(tour *Tour) error
- func (db PostgresRepository) CreateUser(user *User) error
- func (db PostgresRepository) DeleteCityTour(cityTourId int) error
- func (db PostgresRepository) DeleteRestaurantBooking(restaurantBookingId int) error
- func (db PostgresRepository) DeleteTour(tourId int) error
- func (db PostgresRepository) DeleteUser(userId int) error
- func (db PostgresRepository) GetCities() ([]City, error)
- func (db PostgresRepository) GetCityTours(tourId int) []CityTourData
- func (db PostgresRepository) GetEvent(id int) (*Event, error)
- func (db PostgresRepository) GetEvents(filter EventsFilterParameters) ([]EventFeedItem, error)
- func (db PostgresRepository) GetHotel(id int) (*Hotel, error)
- func (db PostgresRepository) GetHotels(filter HotelFilterParameters) ([]HotelFeedItem, error)
- func (db PostgresRepository) GetRestaurant(id int) (*Restaurant, error)
- func (db PostgresRepository) GetRestaurantBookings(cityTourId int) []RestaurantBookingData
- func (db PostgresRepository) GetRestaurants(filter RestaurantFilterParameters) ([]RestaurantFeedItem, error)
- func (db PostgresRepository) GetTicket(id int) (*Ticket, error)
- func (db PostgresRepository) GetTickets(filter TicketFilterParameters) ([]TicketFeedItem, error)
- func (db PostgresRepository) GetTours(userId int) []TourData
- func (db PostgresRepository) GetUser(userId int) *UserData
- func (db PostgresRepository) GetUserByEmail(email string) *User
- func (db PostgresRepository) GetUserEvents(cityTourId int) []EventData
- func (db PostgresRepository) GetUserHotel(cityTourId int) *HotelData
- func (db PostgresRepository) GetUserPassword(userId int) (string, error)
- func (db PostgresRepository) GetUserTickets(cityTourId int) *CityTourTicketData
- func (db *PostgresRepository) Open() error
- func (db PostgresRepository) UpdateCityTour(cityTour *CityTour) error
- func (db PostgresRepository) UpdateRestaurantBooking(restaurantBooking *RestaurantBooking) error
- func (db PostgresRepository) UpdateTour(tour *Tour) error
- func (db PostgresRepository) UpdateUser(user *User) error
- type Repository
- type Restaurant
- type RestaurantBooking
- type RestaurantBookingDTO
- type RestaurantBookingData
- type RestaurantFeedItem
- type RestaurantFilterParameters
- type Ticket
- type TicketData
- type TicketFeedItem
- type TicketFilterParameters
- type Tour
- type TourData
- type User
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CityTour ¶
type CityTour struct { Id int `json:"id"` TourId int `json:"tour_id"` CityId int `json:"city_id"` CityTourPrice float64 `json:"city_tour_price"` DateFrom string `json:"date_from"` DateTo string `json:"date_to"` TicketArrivalId int `json:"ticket_arrival_id"` TicketDepartureId int `json:"ticket_departure_id"` HotelId int `json:"hotel_id"` }
type CityTourData ¶
type CityTourData struct { Id int `json:"city_tour_id"` CountryName string `json:"country_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` CityTourPrice string `json:"city_tour_price"` DateFrom string `json:"date_from"` DateTo string `json:"date_to"` TicketArrivalId int `json:"ticket_arrival_id"` TicketDepartureId int `json:"ticket_departure_id"` HotelId int `json:"hotel_id"` }
type CityTourTicketData ¶
type CityTourTicketData struct { ArrivalTicket TicketData `json:"arrival_ticket"` DepartureTicket TicketData `json:"departure_ticket"` }
type CityTourTicketIdData ¶
type CityToursEvent ¶
type CityToursRestBooking ¶
type Event ¶
type Event struct { EventId int `json:"event_id"` EventName string `json:"event_name"` EventDescription string `json:"event_description"` EventAddr string `json:"event_addr"` CountryName string `json:"country_name"` CityName string `json:"city_name"` EventStart string `json:"event_start"` EventEnd string `json:"event_end"` Price string `json:"price"` Rating float64 `json:"rating"` MaxPersons int `json:"max_persons"` CurPersons int `json:"cur_persons"` Languages []string `json:"languages"` }
type EventFeedItem ¶
type EventFeedItem struct { EventId int `json:"event_id"` EventName string `json:"event_name"` EventStart string `json:"event_start"` EventEnd string `json:"event_end"` Rating float64 `json:"rating"` MaxPersons int `json:"max_persons"` CurPersons int `json:"cur_persons"` CountryName string `json:"country_name"` CityName string `json:"city_name"` }
type EventsFilterParameters ¶
type EventsFilterParameters struct { Limit int `form:"limit"` Offset int `form:"offset"` OrderBy string `form:"order_by"` OrderType string `form:"order_type"` EventName string `form:"event_name"` From string `form:"from"` To string `form:"to"` RatingFrom float64 `form:"rating_from"` RatingTo float64 `form:"rating_to"` PriceFrom float64 `form:"price_from"` PriceTo float64 `form:"price_to"` CityName string `form:"city_name"` }
type Hotel ¶
type Hotel struct { HotelId int `json:"hotel_id"` HotelName string `json:"hotel_name"` HotelDescription string `json:"hotel_description"` HotelAddr string `json:"hotel_addr"` Stars int `json:"stars"` HotelRating float64 `json:"hotel_rating"` AvgPrice string `json:"average_price"` NearSea bool `json:"near_sea"` CountryName string `json:"country_name"` CityName string `json:"city_name"` }
type HotelFeedItem ¶
type HotelFilterParameters ¶
type HotelFilterParameters struct { Limit int `form:"limit"` Offset int `form:"offset"` OrderBy string `form:"order_by"` OrderType string `form:"order_type"` HotelName string `form:"hotel_name"` StarsFrom int `form:"stars_from"` StarsTo int `form:"stars_to"` RatingFrom float64 `form:"rating_from"` RatingTo float64 `form:"rating_to"` PriceFrom float64 `form:"price_from"` PriceTo float64 `form:"price_to"` NearSea bool `form:"near_sea"` CityName string `form:"city_name"` }
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func (PostgresRepository) CreateCityTour ¶
func (db PostgresRepository) CreateCityTour(cityTour *CityTour) error
func (PostgresRepository) CreateCityTourEvent ¶
func (db PostgresRepository) CreateCityTourEvent(cityTourEvent *CityToursEvent) error
func (PostgresRepository) CreateRestaurantBooking ¶
func (db PostgresRepository) CreateRestaurantBooking(restaurantBooking *RestaurantBookingDTO) error
func (PostgresRepository) CreateTour ¶
func (db PostgresRepository) CreateTour(tour *Tour) error
func (PostgresRepository) CreateUser ¶
func (db PostgresRepository) CreateUser(user *User) error
func (PostgresRepository) DeleteCityTour ¶
func (db PostgresRepository) DeleteCityTour(cityTourId int) error
func (PostgresRepository) DeleteRestaurantBooking ¶
func (db PostgresRepository) DeleteRestaurantBooking(restaurantBookingId int) error
func (PostgresRepository) DeleteTour ¶
func (db PostgresRepository) DeleteTour(tourId int) error
func (PostgresRepository) DeleteUser ¶
func (db PostgresRepository) DeleteUser(userId int) error
func (PostgresRepository) GetCities ¶
func (db PostgresRepository) GetCities() ([]City, error)
func (PostgresRepository) GetCityTours ¶
func (db PostgresRepository) GetCityTours(tourId int) []CityTourData
func (PostgresRepository) GetEvents ¶
func (db PostgresRepository) GetEvents(filter EventsFilterParameters) ([]EventFeedItem, error)
func (PostgresRepository) GetHotels ¶
func (db PostgresRepository) GetHotels(filter HotelFilterParameters) ([]HotelFeedItem, error)
func (PostgresRepository) GetRestaurant ¶
func (db PostgresRepository) GetRestaurant(id int) (*Restaurant, error)
func (PostgresRepository) GetRestaurantBookings ¶
func (db PostgresRepository) GetRestaurantBookings(cityTourId int) []RestaurantBookingData
func (PostgresRepository) GetRestaurants ¶
func (db PostgresRepository) GetRestaurants(filter RestaurantFilterParameters) ([]RestaurantFeedItem, error)
func (PostgresRepository) GetTicket ¶
func (db PostgresRepository) GetTicket(id int) (*Ticket, error)
func (PostgresRepository) GetTickets ¶
func (db PostgresRepository) GetTickets(filter TicketFilterParameters) ([]TicketFeedItem, error)
func (PostgresRepository) GetTours ¶
func (db PostgresRepository) GetTours(userId int) []TourData
func (PostgresRepository) GetUser ¶
func (db PostgresRepository) GetUser(userId int) *UserData
func (PostgresRepository) GetUserByEmail ¶
func (db PostgresRepository) GetUserByEmail(email string) *User
func (PostgresRepository) GetUserEvents ¶
func (db PostgresRepository) GetUserEvents(cityTourId int) []EventData
func (PostgresRepository) GetUserHotel ¶
func (db PostgresRepository) GetUserHotel(cityTourId int) *HotelData
func (PostgresRepository) GetUserPassword ¶
func (db PostgresRepository) GetUserPassword(userId int) (string, error)
func (PostgresRepository) GetUserTickets ¶
func (db PostgresRepository) GetUserTickets(cityTourId int) *CityTourTicketData
func (*PostgresRepository) Open ¶
func (db *PostgresRepository) Open() error
func (PostgresRepository) UpdateCityTour ¶
func (db PostgresRepository) UpdateCityTour(cityTour *CityTour) error
func (PostgresRepository) UpdateRestaurantBooking ¶
func (db PostgresRepository) UpdateRestaurantBooking(restaurantBooking *RestaurantBooking) error
func (PostgresRepository) UpdateTour ¶
func (db PostgresRepository) UpdateTour(tour *Tour) error
func (PostgresRepository) UpdateUser ¶
func (db PostgresRepository) UpdateUser(user *User) error
type Repository ¶
type Repository interface { Open() error CreateUser(user *User) error GetUserByEmail(email string) *User GetUser(userId int) *UserData GetUserPassword(userId int) (string, error) GetTours(userId int) []TourData GetCityTours(tourId int) []CityTourData GetUserEvents(cityTourId int) []EventData GetRestaurantBookings(cityTourId int) []RestaurantBookingData GetUserTickets(cityTourId int) *CityTourTicketData GetUserHotel(cityTourId int) *HotelData CreateTour(tour *Tour) error CreateCityTour(cityTour *CityTour) error CreateCityTourEvent(cityTourEvent *CityToursEvent) error CreateRestaurantBooking(restaurantBooking *RestaurantBookingDTO) error UpdateUser(user *User) error UpdateTour(tour *Tour) error UpdateCityTour(cityTour *CityTour) error UpdateRestaurantBooking(restaurantBooking *RestaurantBooking) error DeleteUser(userId int) error DeleteTour(tourId int) error DeleteCityTour(cityTourId int) error DeleteRestaurantBooking(restaurantBookingId int) error GetCities() ([]City, error) GetHotel(id int) (*Hotel, error) GetEvent(id int) (*Event, error) GetRestaurant(id int) (*Restaurant, error) GetTicket(id int) (*Ticket, error) GetHotels(filter HotelFilterParameters) ([]HotelFeedItem, error) GetEvents(filter EventsFilterParameters) ([]EventFeedItem, error) GetRestaurants(filter RestaurantFilterParameters) ([]RestaurantFeedItem, error) GetTickets(filter TicketFilterParameters) ([]TicketFeedItem, error) // contains filtered or unexported methods }
func CreateRepository ¶
func CreateRepository(conf config.DbConfig) Repository
type Restaurant ¶
type Restaurant struct { RestaurantId int `json:"restaurant_id"` RestName string `json:"restaurant_name"` RestDescription string `json:"restaurant_description"` RestAddr string `json:"restaurant_addr"` AvgPrice string `json:"average_price"` RestRating float64 `json:"rating"` ChildMenu bool `json:"child_menu"` SmokingRoom bool `json:"smoking_room"` CountryName string `json:"country_name"` CityName string `json:"city_name"` }
type RestaurantBooking ¶
type RestaurantBookingDTO ¶
type RestaurantBookingData ¶
type RestaurantFeedItem ¶
type RestaurantFilterParameters ¶
type RestaurantFilterParameters struct { Limit int `form:"limit"` Offset int `form:"offset"` OrderBy string `form:"order_by"` OrderType string `form:"order_type"` RestaurantName string `form:"restaurant_name"` RatingFrom float64 `form:"rating_from"` RatingTo float64 `form:"rating_to"` PriceFrom float64 `form:"price_from"` PriceTo float64 `form:"price_to"` ChildMenu bool `form:"child_menu"` SmokingRoom bool `form:"smoking_room"` CityName string `form:"city_name"` }
type Ticket ¶
type Ticket struct { TicketId int `json:"ticket_id"` CompanyName string `json:"company_name"` CompanyRating float64 `json:"company_rating"` OrigStationName string `json:"orig_station_name"` OrigStationAddr string `json:"orig_station_addr"` OrigCountryName string `json:"orig_country_name"` OrigCityName string `json:"orig_city_name"` DestStationName string `json:"dest_station_name"` DestStationAddr string `json:"dest_station_addr"` DestCityName string `json:"dest_city_name"` DestCountryName string `json:"dest_country_name"` TransportType string `json:"transport_type"` Price string `json:"price"` TicketDate string `json:"ticket_date"` }
type TicketData ¶
type TicketData struct { Id int `json:"ticket_id"` TransportType string `json:"transport_type"` Price string `json:"price"` Date string `json:"date"` OrigCountryName string `json:"orig_country_name"` OrigCityName string `json:"orig_city_name"` DestCountryName string `json:"dest_country_name"` DestCityName string `json:"dest_city_name"` CompanyName string `json:"company_name"` CompanyRating float64 `json:"company_rating"` }
type TicketFeedItem ¶
type TicketFeedItem struct { TicketId int `json:"ticket_id"` TransportType string `json:"transport_type"` Price string `json:"price"` Date string `json:"date"` OrigCountryName string `json:"orig_country_name"` OrigCityName string `json:"orig_city_name"` DestCountryName string `json:"dest_country_name"` DestCityName string `json:"dest_city_name"` }
type TicketFilterParameters ¶
type TicketFilterParameters struct { Limit int `form:"limit"` Offset int `form:"offset"` OrderBy string `form:"order_by"` OrderType string `form:"order_type"` TransportType string `form:"transport_type"` DateFrom string `form:"date_from"` DateTo string `form:"date_to"` PriceFrom float64 `form:"price_from"` PriceTo float64 `form:"price_to"` OrigCityName string `form:"orig_city_name"` DestCityName string `form:"dest_city_name"` }
Click to show internal directories.
Click to hide internal directories.