hotels

package
v0.0.0-...-f5cdc36 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExchangeName = "hotels"

	UpdateImageQueue       = "update_hotel_image"
	UpdateImageBindingKey  = "update_hotel_image_key"
	UpdateImageWorkers     = 5
	UpdateImageConsumerTag = "update_hotel_image_consumer"
)

Variables

View Source
var (
	ErrInvalidUUID            = errors.New("invalid uuid")
	ErrInvalidDeliveryHeaders = errors.New("invalid delivery headers")
	ErrInternalServerError    = errors.New("internal server error")
	ErrInvalidImageFormat     = errors.New("invalid file format")
	ErrHotelNotFound          = errors.New("hotel not found")
)
View Source
var File_app_hotels_hotels_proto protoreflect.FileDescriptor

Functions

func GeneratePointToGeoFromFloat64

func GeneratePointToGeoFromFloat64(latitude float64, longitude float64) string

func RegisterHotelsServiceServer

func RegisterHotelsServiceServer(s *grpc.Server, srv HotelsServiceServer)

Types

type Application

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

func NewApplication

func NewApplication(logger logger.Logger, cfg *config.Config, redisConn *redis.Client, pgxPool *pgxpool.Pool, tracer opentracing.Tracer) Application

func (*Application) Run

func (s *Application) Run() error

type Consumer

type Consumer struct {
	Worker         func(ctx context.Context, wg *sync.WaitGroup, messages <-chan amqp.Delivery)
	QueueName      string
	ConsumerTag    string
	WorkerPoolSize int
}

type ConsumerImpl

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

func NewHotelsConsumer

func NewHotelsConsumer(logger logger.Logger, cfg *config.Config, service Service) ConsumerImpl

func (*ConsumerImpl) AddConsumer

func (c *ConsumerImpl) AddConsumer(consumer *Consumer)

func (*ConsumerImpl) CloseChannels

func (c *ConsumerImpl) CloseChannels()

CloseChannels close active channels

func (*ConsumerImpl) CreateExchangeAndQueue

func (c *ConsumerImpl) CreateExchangeAndQueue(exchangeName, queueName, bindingKey string) (*amqp.Channel, error)

func (*ConsumerImpl) Dial

func (c *ConsumerImpl) Dial() error

func (*ConsumerImpl) Initialize

func (c *ConsumerImpl) Initialize() error

func (*ConsumerImpl) RunConsumers

func (c *ConsumerImpl) RunConsumers(ctx context.Context, cancel context.CancelFunc)

type CreateHotelRequest

type CreateHotelRequest struct {
	Name          string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Email         string   `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"`
	Country       string   `protobuf:"bytes,3,opt,name=Country,proto3" json:"Country,omitempty"`
	City          string   `protobuf:"bytes,4,opt,name=City,proto3" json:"City,omitempty"`
	Description   string   `protobuf:"bytes,5,opt,name=Description,proto3" json:"Description,omitempty"`
	Location      string   `protobuf:"bytes,6,opt,name=Location,proto3" json:"Location,omitempty"`
	Image         string   `protobuf:"bytes,8,opt,name=Image,proto3" json:"Image,omitempty"`
	Photos        []string `protobuf:"bytes,9,rep,name=Photos,proto3" json:"Photos,omitempty"`
	CommentsCount int64    `protobuf:"varint,10,opt,name=CommentsCount,proto3" json:"CommentsCount,omitempty"`
	Rating        float64  `protobuf:"fixed64,7,opt,name=Rating,proto3" json:"Rating,omitempty"`
	Latitude      float64  `protobuf:"fixed64,11,opt,name=Latitude,proto3" json:"Latitude,omitempty"`
	Longitude     float64  `protobuf:"fixed64,12,opt,name=Longitude,proto3" json:"Longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateHotelRequest) Descriptor deprecated

func (*CreateHotelRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateHotelRequest.ProtoReflect.Descriptor instead.

func (*CreateHotelRequest) GetCity

func (x *CreateHotelRequest) GetCity() string

func (*CreateHotelRequest) GetCommentsCount

func (x *CreateHotelRequest) GetCommentsCount() int64

func (*CreateHotelRequest) GetCountry

func (x *CreateHotelRequest) GetCountry() string

func (*CreateHotelRequest) GetDescription

func (x *CreateHotelRequest) GetDescription() string

func (*CreateHotelRequest) GetEmail

func (x *CreateHotelRequest) GetEmail() string

func (*CreateHotelRequest) GetImage

func (x *CreateHotelRequest) GetImage() string

func (*CreateHotelRequest) GetLatitude

func (x *CreateHotelRequest) GetLatitude() float64

func (*CreateHotelRequest) GetLocation

func (x *CreateHotelRequest) GetLocation() string

func (*CreateHotelRequest) GetLongitude

func (x *CreateHotelRequest) GetLongitude() float64

func (*CreateHotelRequest) GetName

func (x *CreateHotelRequest) GetName() string

func (*CreateHotelRequest) GetPhotos

func (x *CreateHotelRequest) GetPhotos() []string

func (*CreateHotelRequest) GetRating

func (x *CreateHotelRequest) GetRating() float64

func (*CreateHotelRequest) ProtoMessage

func (*CreateHotelRequest) ProtoMessage()

func (*CreateHotelRequest) ProtoReflect

func (x *CreateHotelRequest) ProtoReflect() protoreflect.Message

func (*CreateHotelRequest) Reset

func (x *CreateHotelRequest) Reset()

func (*CreateHotelRequest) String

func (x *CreateHotelRequest) String() string

type CreateHotelResponse

type CreateHotelResponse struct {
	Hotel *Hotel `protobuf:"bytes,1,opt,name=Hotel,proto3" json:"Hotel,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateHotelResponse) Descriptor deprecated

func (*CreateHotelResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateHotelResponse.ProtoReflect.Descriptor instead.

func (*CreateHotelResponse) GetHotel

func (x *CreateHotelResponse) GetHotel() *Hotel

func (*CreateHotelResponse) ProtoMessage

func (*CreateHotelResponse) ProtoMessage()

func (*CreateHotelResponse) ProtoReflect

func (x *CreateHotelResponse) ProtoReflect() protoreflect.Message

func (*CreateHotelResponse) Reset

func (x *CreateHotelResponse) Reset()

func (*CreateHotelResponse) String

func (x *CreateHotelResponse) String() string

type GRPCServer

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

func NewServer

func NewServer(service Service, logger logger.Logger, validate *validator.Validate) GRPCServer

func (*GRPCServer) CreateHotel

func (h *GRPCServer) CreateHotel(ctx context.Context, req *CreateHotelRequest) (*CreateHotelResponse, error)

func (*GRPCServer) GetHotelByID

func (h *GRPCServer) GetHotelByID(ctx context.Context, req *GetByIDRequest) (*GetByIDResponse, error)

func (*GRPCServer) GetHotels

func (h *GRPCServer) GetHotels(ctx context.Context, req *GetHotelsRequest) (*GetHotelsResponse, error)

func (*GRPCServer) UpdateHotel

func (h *GRPCServer) UpdateHotel(ctx context.Context, req *UpdateHotelRequest) (*UpdateHotelResponse, error)

func (*GRPCServer) UploadImage

func (h *GRPCServer) UploadImage(ctx context.Context, req *UploadImageRequest) (*UploadImageResponse, error)

type GetByIDRequest

type GetByIDRequest struct {
	HotelID string `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetByIDRequest) Descriptor deprecated

func (*GetByIDRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetByIDRequest.ProtoReflect.Descriptor instead.

func (*GetByIDRequest) GetHotelID

func (x *GetByIDRequest) GetHotelID() string

func (*GetByIDRequest) ProtoMessage

func (*GetByIDRequest) ProtoMessage()

func (*GetByIDRequest) ProtoReflect

func (x *GetByIDRequest) ProtoReflect() protoreflect.Message

func (*GetByIDRequest) Reset

func (x *GetByIDRequest) Reset()

func (*GetByIDRequest) String

func (x *GetByIDRequest) String() string

type GetByIDResponse

type GetByIDResponse struct {
	Hotel *Hotel `protobuf:"bytes,1,opt,name=Hotel,proto3" json:"Hotel,omitempty"`
	// contains filtered or unexported fields
}

func (*GetByIDResponse) Descriptor deprecated

func (*GetByIDResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetByIDResponse.ProtoReflect.Descriptor instead.

func (*GetByIDResponse) GetHotel

func (x *GetByIDResponse) GetHotel() *Hotel

func (*GetByIDResponse) ProtoMessage

func (*GetByIDResponse) ProtoMessage()

func (*GetByIDResponse) ProtoReflect

func (x *GetByIDResponse) ProtoReflect() protoreflect.Message

func (*GetByIDResponse) Reset

func (x *GetByIDResponse) Reset()

func (*GetByIDResponse) String

func (x *GetByIDResponse) String() string

type GetHotelsRequest

type GetHotelsRequest struct {
	Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*GetHotelsRequest) Descriptor deprecated

func (*GetHotelsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetHotelsRequest.ProtoReflect.Descriptor instead.

func (*GetHotelsRequest) GetPage

func (x *GetHotelsRequest) GetPage() int64

func (*GetHotelsRequest) GetSize

func (x *GetHotelsRequest) GetSize() int64

func (*GetHotelsRequest) ProtoMessage

func (*GetHotelsRequest) ProtoMessage()

func (*GetHotelsRequest) ProtoReflect

func (x *GetHotelsRequest) ProtoReflect() protoreflect.Message

func (*GetHotelsRequest) Reset

func (x *GetHotelsRequest) Reset()

func (*GetHotelsRequest) String

func (x *GetHotelsRequest) String() string

type GetHotelsResponse

type GetHotelsResponse struct {
	TotalCount int64    `protobuf:"varint,1,opt,name=TotalCount,proto3" json:"TotalCount,omitempty"`
	TotalPages int64    `protobuf:"varint,2,opt,name=TotalPages,proto3" json:"TotalPages,omitempty"`
	Page       int64    `protobuf:"varint,3,opt,name=Page,proto3" json:"Page,omitempty"`
	Size       int64    `protobuf:"varint,4,opt,name=Size,proto3" json:"Size,omitempty"`
	HasMore    bool     `protobuf:"varint,5,opt,name=HasMore,proto3" json:"HasMore,omitempty"`
	Hotels     []*Hotel `protobuf:"bytes,6,rep,name=Hotels,proto3" json:"Hotels,omitempty"`
	// contains filtered or unexported fields
}

func (*GetHotelsResponse) Descriptor deprecated

func (*GetHotelsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetHotelsResponse.ProtoReflect.Descriptor instead.

func (*GetHotelsResponse) GetHasMore

func (x *GetHotelsResponse) GetHasMore() bool

func (*GetHotelsResponse) GetHotels

func (x *GetHotelsResponse) GetHotels() []*Hotel

func (*GetHotelsResponse) GetPage

func (x *GetHotelsResponse) GetPage() int64

func (*GetHotelsResponse) GetSize

func (x *GetHotelsResponse) GetSize() int64

func (*GetHotelsResponse) GetTotalCount

func (x *GetHotelsResponse) GetTotalCount() int64

func (*GetHotelsResponse) GetTotalPages

func (x *GetHotelsResponse) GetTotalPages() int64

func (*GetHotelsResponse) ProtoMessage

func (*GetHotelsResponse) ProtoMessage()

func (*GetHotelsResponse) ProtoReflect

func (x *GetHotelsResponse) ProtoReflect() protoreflect.Message

func (*GetHotelsResponse) Reset

func (x *GetHotelsResponse) Reset()

func (*GetHotelsResponse) String

func (x *GetHotelsResponse) String() string

type Hotel

type Hotel struct {
	CreatedAt     *timestamp.Timestamp `protobuf:"bytes,14,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"`
	UpdatedAt     *timestamp.Timestamp `protobuf:"bytes,15,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"`
	HotelID       string               `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"`
	Name          string               `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	Email         string               `protobuf:"bytes,3,opt,name=Email,proto3" json:"Email,omitempty"`
	Country       string               `protobuf:"bytes,4,opt,name=Country,proto3" json:"Country,omitempty"`
	City          string               `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"`
	Description   string               `protobuf:"bytes,6,opt,name=Description,proto3" json:"Description,omitempty"`
	Location      string               `protobuf:"bytes,7,opt,name=Location,proto3" json:"Location,omitempty"`
	Image         string               `protobuf:"bytes,9,opt,name=Image,proto3" json:"Image,omitempty"`
	Photos        []string             `protobuf:"bytes,10,rep,name=Photos,proto3" json:"Photos,omitempty"`
	CommentsCount int64                `protobuf:"varint,11,opt,name=CommentsCount,proto3" json:"CommentsCount,omitempty"`
	Rating        float64              `protobuf:"fixed64,8,opt,name=Rating,proto3" json:"Rating,omitempty"`
	Latitude      float64              `protobuf:"fixed64,12,opt,name=Latitude,proto3" json:"Latitude,omitempty"`
	Longitude     float64              `protobuf:"fixed64,13,opt,name=Longitude,proto3" json:"Longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*Hotel) Descriptor deprecated

func (*Hotel) Descriptor() ([]byte, []int)

Deprecated: Use Hotel.ProtoReflect.Descriptor instead.

func (*Hotel) GetCity

func (x *Hotel) GetCity() string

func (*Hotel) GetCommentsCount

func (x *Hotel) GetCommentsCount() int64

func (*Hotel) GetCountry

func (x *Hotel) GetCountry() string

func (*Hotel) GetCreatedAt

func (x *Hotel) GetCreatedAt() *timestamp.Timestamp

func (*Hotel) GetDescription

func (x *Hotel) GetDescription() string

func (*Hotel) GetEmail

func (x *Hotel) GetEmail() string

func (*Hotel) GetHotelID

func (x *Hotel) GetHotelID() string

func (*Hotel) GetImage

func (x *Hotel) GetImage() string

func (*Hotel) GetLatitude

func (x *Hotel) GetLatitude() float64

func (*Hotel) GetLocation

func (x *Hotel) GetLocation() string

func (*Hotel) GetLongitude

func (x *Hotel) GetLongitude() float64

func (*Hotel) GetName

func (x *Hotel) GetName() string

func (*Hotel) GetPhotos

func (x *Hotel) GetPhotos() []string

func (*Hotel) GetRating

func (x *Hotel) GetRating() float64

func (*Hotel) GetUpdatedAt

func (x *Hotel) GetUpdatedAt() *timestamp.Timestamp

func (*Hotel) ProtoMessage

func (*Hotel) ProtoMessage()

func (*Hotel) ProtoReflect

func (x *Hotel) ProtoReflect() protoreflect.Message

func (*Hotel) Reset

func (x *Hotel) Reset()

func (*Hotel) String

func (x *Hotel) String() string

type HotelDO

type HotelDO struct {
	Image         *string    `json:"image,omitempty"`
	UpdatedAt     *time.Time `json:"updated_at"`
	CreatedAt     *time.Time `json:"created_at"`
	Longitude     *float64   `json:"longitude,omitempty"`
	Latitude      *float64   `json:"latitude,omitempty"`
	Location      string     `json:"location" validate:"required,min=10,max=250"`
	Description   string     `json:"description,omitempty" validate:"required,min=10,max=250"`
	City          string     `json:"city,omitempty" validate:"required,min=3,max=25"`
	Country       string     `json:"country,omitempty" validate:"required,min=3,max=25"`
	Email         string     `json:"email,omitempty" validate:"required,email"`
	Name          string     `json:"name" validate:"required,min=3,max=25"`
	Photos        []string   `json:"photos,omitempty"`
	Rating        float64    `json:"rating" validate:"required,min=0,max=10"`
	CommentsCount int        `json:"comments_count,omitempty"`
	HotelID       uuid.UUID  `json:"hotel_id"`
}

HotelDO model

func (*HotelDO) GetImage

func (h *HotelDO) GetImage() string

func (*HotelDO) GetLatitude

func (h *HotelDO) GetLatitude() float64

func (*HotelDO) GetLongitude

func (h *HotelDO) GetLongitude() float64

func (*HotelDO) ToProto

func (h *HotelDO) ToProto() *Hotel

type HotelsServiceClient

type HotelsServiceClient interface {
	CreateHotel(ctx context.Context, in *CreateHotelRequest, opts ...grpc.CallOption) (*CreateHotelResponse, error)
	UpdateHotel(ctx context.Context, in *UpdateHotelRequest, opts ...grpc.CallOption) (*UpdateHotelResponse, error)
	GetHotelByID(ctx context.Context, in *GetByIDRequest, opts ...grpc.CallOption) (*GetByIDResponse, error)
	GetHotels(ctx context.Context, in *GetHotelsRequest, opts ...grpc.CallOption) (*GetHotelsResponse, error)
	UploadImage(ctx context.Context, in *UploadImageRequest, opts ...grpc.CallOption) (*UploadImageResponse, error)
}

HotelsServiceClient is the client API for HotelsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type HotelsServiceServer

HotelsServiceServer is the server API for HotelsService service.

type List

type List struct {
	Hotels     []*HotelDO `json:"comments"`
	TotalCount int        `json:"totalCount"`
	TotalPages int        `json:"totalPages"`
	Page       int        `json:"page"`
	Size       int        `json:"size"`
	HasMore    bool       `json:"hasMore"`
}

All Hotels response with pagination

func (*List) ToProto

func (h *List) ToProto() []*Hotel

type Publisher

type Publisher interface {
	CreateExchangeAndQueue(exchange, queueName, bindingKey string) (*amqp.Channel, error)
	Publish(ctx context.Context, exchange, routingKey, contentType string, headers amqp.Table, body []byte) error
}

type PublisherImpl

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

func NewHotelsPublisher

func NewHotelsPublisher(cfg *config.Config, logger logger.Logger) (PublisherImpl, error)

func (*PublisherImpl) CreateExchangeAndQueue

func (p *PublisherImpl) CreateExchangeAndQueue(exchange, queueName, bindingKey string) (*amqp.Channel, error)

func (*PublisherImpl) Publish

func (p *PublisherImpl) Publish(ctx context.Context, exchange, routingKey, contentType string, headers amqp.Table, body []byte) error

type Repository

type Repository interface {
	CreateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)
	UpdateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)
	UpdateHotelImage(ctx context.Context, hotelID uuid.UUID, imageURL string) error
	GetHotelByID(ctx context.Context, hotelID uuid.UUID) (*HotelDO, error)
	GetHotels(ctx context.Context, query *pagination.Pagination) (*List, error)
}

type RepositoryImpl

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

func NewRepository

func NewRepository(db *pgxpool.Pool) RepositoryImpl

func (*RepositoryImpl) CreateHotel

func (h *RepositoryImpl) CreateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)

func (*RepositoryImpl) GetHotelByID

func (h *RepositoryImpl) GetHotelByID(ctx context.Context, hotelID uuid.UUID) (*HotelDO, error)

func (*RepositoryImpl) GetHotels

func (h *RepositoryImpl) GetHotels(ctx context.Context, query *pagination.Pagination) (*List, error)

func (*RepositoryImpl) UpdateHotel

func (h *RepositoryImpl) UpdateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)

func (*RepositoryImpl) UpdateHotelImage

func (h *RepositoryImpl) UpdateHotelImage(ctx context.Context, hotelID uuid.UUID, imageURL string) error

type Service

type Service interface {
	CreateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)
	UpdateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)
	GetHotelByID(ctx context.Context, hotelID uuid.UUID) (*HotelDO, error)
	GetHotels(ctx context.Context, query *pagination.Pagination) (*List, error)
	UploadImage(ctx context.Context, msg *UploadHotelImageMsg) error
	UpdateHotelImage(ctx context.Context, delivery amqp.Delivery) error
}

type ServiceImpl

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

func NewService

func NewService(repository Repository, logger logger.Logger, publisher Publisher) ServiceImpl

func (*ServiceImpl) CreateHotel

func (h *ServiceImpl) CreateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)

func (*ServiceImpl) GetHotelByID

func (h *ServiceImpl) GetHotelByID(ctx context.Context, hotelID uuid.UUID) (*HotelDO, error)

func (*ServiceImpl) GetHotels

func (h *ServiceImpl) GetHotels(ctx context.Context, query *pagination.Pagination) (*List, error)

func (*ServiceImpl) UpdateHotel

func (h *ServiceImpl) UpdateHotel(ctx context.Context, hotel *HotelDO) (*HotelDO, error)

func (*ServiceImpl) UpdateHotelImage

func (h *ServiceImpl) UpdateHotelImage(ctx context.Context, delivery amqp.Delivery) error

func (*ServiceImpl) UploadImage

func (h *ServiceImpl) UploadImage(ctx context.Context, msg *UploadHotelImageMsg) error

type UnimplementedHotelsServiceServer

type UnimplementedHotelsServiceServer struct {
}

UnimplementedHotelsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedHotelsServiceServer) CreateHotel

func (*UnimplementedHotelsServiceServer) GetHotelByID

func (*UnimplementedHotelsServiceServer) GetHotels

func (*UnimplementedHotelsServiceServer) UpdateHotel

func (*UnimplementedHotelsServiceServer) UploadImage

type UpdateHotelImageMsg

type UpdateHotelImageMsg struct {
	Image   string    `json:"image,omitempty"`
	HotelID uuid.UUID `json:"hotel_id"`
}

type UpdateHotelRequest

type UpdateHotelRequest struct {
	HotelID       string   `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"`
	Name          string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	Email         string   `protobuf:"bytes,3,opt,name=Email,proto3" json:"Email,omitempty"`
	Country       string   `protobuf:"bytes,4,opt,name=Country,proto3" json:"Country,omitempty"`
	City          string   `protobuf:"bytes,5,opt,name=City,proto3" json:"City,omitempty"`
	Description   string   `protobuf:"bytes,6,opt,name=Description,proto3" json:"Description,omitempty"`
	Location      string   `protobuf:"bytes,7,opt,name=Location,proto3" json:"Location,omitempty"`
	Image         string   `protobuf:"bytes,9,opt,name=Image,proto3" json:"Image,omitempty"`
	Photos        []string `protobuf:"bytes,10,rep,name=Photos,proto3" json:"Photos,omitempty"`
	CommentsCount int64    `protobuf:"varint,11,opt,name=CommentsCount,proto3" json:"CommentsCount,omitempty"`
	Rating        float64  `protobuf:"fixed64,8,opt,name=Rating,proto3" json:"Rating,omitempty"`
	Latitude      float64  `protobuf:"fixed64,12,opt,name=Latitude,proto3" json:"Latitude,omitempty"`
	Longitude     float64  `protobuf:"fixed64,13,opt,name=Longitude,proto3" json:"Longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateHotelRequest) Descriptor deprecated

func (*UpdateHotelRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateHotelRequest.ProtoReflect.Descriptor instead.

func (*UpdateHotelRequest) GetCity

func (x *UpdateHotelRequest) GetCity() string

func (*UpdateHotelRequest) GetCommentsCount

func (x *UpdateHotelRequest) GetCommentsCount() int64

func (*UpdateHotelRequest) GetCountry

func (x *UpdateHotelRequest) GetCountry() string

func (*UpdateHotelRequest) GetDescription

func (x *UpdateHotelRequest) GetDescription() string

func (*UpdateHotelRequest) GetEmail

func (x *UpdateHotelRequest) GetEmail() string

func (*UpdateHotelRequest) GetHotelID

func (x *UpdateHotelRequest) GetHotelID() string

func (*UpdateHotelRequest) GetImage

func (x *UpdateHotelRequest) GetImage() string

func (*UpdateHotelRequest) GetLatitude

func (x *UpdateHotelRequest) GetLatitude() float64

func (*UpdateHotelRequest) GetLocation

func (x *UpdateHotelRequest) GetLocation() string

func (*UpdateHotelRequest) GetLongitude

func (x *UpdateHotelRequest) GetLongitude() float64

func (*UpdateHotelRequest) GetName

func (x *UpdateHotelRequest) GetName() string

func (*UpdateHotelRequest) GetPhotos

func (x *UpdateHotelRequest) GetPhotos() []string

func (*UpdateHotelRequest) GetRating

func (x *UpdateHotelRequest) GetRating() float64

func (*UpdateHotelRequest) ProtoMessage

func (*UpdateHotelRequest) ProtoMessage()

func (*UpdateHotelRequest) ProtoReflect

func (x *UpdateHotelRequest) ProtoReflect() protoreflect.Message

func (*UpdateHotelRequest) Reset

func (x *UpdateHotelRequest) Reset()

func (*UpdateHotelRequest) String

func (x *UpdateHotelRequest) String() string

type UpdateHotelResponse

type UpdateHotelResponse struct {
	Hotel *Hotel `protobuf:"bytes,1,opt,name=Hotel,proto3" json:"Hotel,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateHotelResponse) Descriptor deprecated

func (*UpdateHotelResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateHotelResponse.ProtoReflect.Descriptor instead.

func (*UpdateHotelResponse) GetHotel

func (x *UpdateHotelResponse) GetHotel() *Hotel

func (*UpdateHotelResponse) ProtoMessage

func (*UpdateHotelResponse) ProtoMessage()

func (*UpdateHotelResponse) ProtoReflect

func (x *UpdateHotelResponse) ProtoReflect() protoreflect.Message

func (*UpdateHotelResponse) Reset

func (x *UpdateHotelResponse) Reset()

func (*UpdateHotelResponse) String

func (x *UpdateHotelResponse) String() string

type UploadHotelImageMsg

type UploadHotelImageMsg struct {
	ContentType string    `json:"content_type"`
	Data        []byte    `json:"date"`
	HotelID     uuid.UUID `json:"hotel_id"`
}

UpdateHotelImageMsg

type UploadImageRequest

type UploadImageRequest struct {
	HotelID     string `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"`
	ContentType string `protobuf:"bytes,3,opt,name=ContentType,proto3" json:"ContentType,omitempty"`
	Data        []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadImageRequest) Descriptor deprecated

func (*UploadImageRequest) Descriptor() ([]byte, []int)

Deprecated: Use UploadImageRequest.ProtoReflect.Descriptor instead.

func (*UploadImageRequest) GetContentType

func (x *UploadImageRequest) GetContentType() string

func (*UploadImageRequest) GetData

func (x *UploadImageRequest) GetData() []byte

func (*UploadImageRequest) GetHotelID

func (x *UploadImageRequest) GetHotelID() string

func (*UploadImageRequest) ProtoMessage

func (*UploadImageRequest) ProtoMessage()

func (*UploadImageRequest) ProtoReflect

func (x *UploadImageRequest) ProtoReflect() protoreflect.Message

func (*UploadImageRequest) Reset

func (x *UploadImageRequest) Reset()

func (*UploadImageRequest) String

func (x *UploadImageRequest) String() string

type UploadImageResponse

type UploadImageResponse struct {
	HotelID string `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadImageResponse) Descriptor deprecated

func (*UploadImageResponse) Descriptor() ([]byte, []int)

Deprecated: Use UploadImageResponse.ProtoReflect.Descriptor instead.

func (*UploadImageResponse) GetHotelID

func (x *UploadImageResponse) GetHotelID() string

func (*UploadImageResponse) ProtoMessage

func (*UploadImageResponse) ProtoMessage()

func (*UploadImageResponse) ProtoReflect

func (x *UploadImageResponse) ProtoReflect() protoreflect.Message

func (*UploadImageResponse) Reset

func (x *UploadImageResponse) Reset()

func (*UploadImageResponse) String

func (x *UploadImageResponse) String() string

Jump to

Keyboard shortcuts

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