Documentation ¶
Overview ¶
Copyright (c) 2023 Tiago Melo. All rights reserved. Use of this source code is governed by the MIT License that can be found in the LICENSE file.
Package mapper provides functions for converting between Protobuf messages and MongoDB models in the context of a product catalog. The functions in this package handle the conversion of product data between the Protobuf representation used in the API and the MongoDB model representation used in the data store.
Index ¶
- func ProductModelListToListProductsResponse(dbProducts []*models.Product) (*productcatalog.ListProductsResponse, error)
- func ProductModelToProductProtobuf(dbProduct *models.Product) (*productcatalog.Product, error)
- func ProductProtobufToProductModel(product *productcatalog.Product) (*models.Product, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProductModelListToListProductsResponse ¶
func ProductModelListToListProductsResponse(dbProducts []*models.Product) (*productcatalog.ListProductsResponse, error)
ProductModelListToListProductsResponse converts a list of MongoDB Product models to a Protobuf ListProductsResponse message.
func ProductModelToProductProtobuf ¶
func ProductModelToProductProtobuf(dbProduct *models.Product) (*productcatalog.Product, error)
ProductModelToProductProtobuf converts a MongoDB Product model to a Protobuf Product message.
func ProductProtobufToProductModel ¶
func ProductProtobufToProductModel(product *productcatalog.Product) (*models.Product, error)
ProductProtobufToProductModel converts a Protobuf Product message to a MongoDB Product model.
Types ¶
This section is empty.