mapper

package
v0.0.0-...-42d6aa1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 4 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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