apimapper

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 2 Imported by: 0

README

Mapper Layer

This package provides mappers to convert data between various layers such as:

  • Database records
  • API responses
  • Proto (gRPC) messages
  • Service domain logic

Each subdirectory is organized by conversion type and grouped by feature/domain (e.g., Auth, User, Topup).

Structure

  • record/: Maps from database models to internal record representations.
  • response/: Maps from records to API/service responses.
    • api/: Used in controller/handler layer for HTTP/gRPC responses.
    • service/: Used within services to transform internal models into service outputs.
  • proto/: Maps between proto (gRPC) messages and domain models.

All mappers implement interfaces for maintainability and ease of testing.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapPaginationMeta

func MapPaginationMeta(s *pb.PaginationMeta) *response.PaginationMeta

mapPaginationMeta maps a gRPC PaginationMeta to an HTTP-compatible API response PaginationMeta.

Args:

  • s: A pointer to a pb.PaginationMeta containing the gRPC response data.

Returns:

  • A pointer to a response.PaginationMeta containing the mapped data, including current page, page size, total records, and total pages.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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