grpcclient

package
v0.0.0-...-fb81480 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package grpcclient facilitates communication with external gRPC services, specifically for exchange rate retrieval and currency exchange operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exchange

type Exchange struct {
	MainAPI
}

Exchange represents the GRPC client handler with methods for fetching exchange rates and performing exchanges.

func New

func New(services *service.Service, logger *slog.Logger) *Exchange

New creates and returns a new instance of the Exchange handler with the provided services and logger.

type MainAPI

type MainAPI interface {
	// GetExchangeRates to fetch exchange rates
	GetExchangeRates(ctx *gin.Context)

	// ExchangeSum to exchange currency
	ExchangeSum(ctx *gin.Context)

	// CloseGRPC to close GRPC connection
	CloseGRPC() error
}

MainAPI is an interface that defines the methods required for handling GRPC client operations.

Jump to

Keyboard shortcuts

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