currency

package
v0.0.0-...-0902e11 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Currencies_name = map[int32]string{
		0:  "EUR",
		1:  "USD",
		2:  "JPY",
		3:  "BGN",
		4:  "CZK",
		5:  "DKK",
		6:  "GBP",
		7:  "HUF",
		8:  "PLN",
		9:  "RON",
		10: "SEK",
		11: "CHF",
		12: "ISK",
		13: "NOK",
		14: "HRK",
		15: "RUB",
		16: "TRY",
		17: "AUD",
		18: "BRL",
		19: "CAD",
		20: "CNY",
		21: "HKD",
		22: "IDR",
		23: "ILS",
		24: "INR",
		25: "KRW",
		26: "MXN",
		27: "MYR",
		28: "NZD",
		29: "PHP",
		30: "SGD",
		31: "THB",
		32: "ZAR",
	}
	Currencies_value = map[string]int32{
		"EUR": 0,
		"USD": 1,
		"JPY": 2,
		"BGN": 3,
		"CZK": 4,
		"DKK": 5,
		"GBP": 6,
		"HUF": 7,
		"PLN": 8,
		"RON": 9,
		"SEK": 10,
		"CHF": 11,
		"ISK": 12,
		"NOK": 13,
		"HRK": 14,
		"RUB": 15,
		"TRY": 16,
		"AUD": 17,
		"BRL": 18,
		"CAD": 19,
		"CNY": 20,
		"HKD": 21,
		"IDR": 22,
		"ILS": 23,
		"INR": 24,
		"KRW": 25,
		"MXN": 26,
		"MYR": 27,
		"NZD": 28,
		"PHP": 29,
		"SGD": 30,
		"THB": 31,
		"ZAR": 32,
	}
)

Enum value maps for Currencies.

View Source
var Currency_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Currency",
	HandlerType: (*CurrencyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetRate",
			Handler:    _Currency_GetRate_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeRate",
			Handler:       _Currency_SubscribeRate_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "protos/currency.proto",
}

Currency_ServiceDesc is the grpc.ServiceDesc for Currency service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_protos_currency_proto protoreflect.FileDescriptor

Functions

func RegisterCurrencyServer

func RegisterCurrencyServer(s grpc.ServiceRegistrar, srv CurrencyServer)

Types

type Currencies

type Currencies int32

Currencies is an enum which represents the allowed currencies for the API

const (
	Currencies_EUR Currencies = 0
	Currencies_USD Currencies = 1
	Currencies_JPY Currencies = 2
	Currencies_BGN Currencies = 3
	Currencies_CZK Currencies = 4
	Currencies_DKK Currencies = 5
	Currencies_GBP Currencies = 6
	Currencies_HUF Currencies = 7
	Currencies_PLN Currencies = 8
	Currencies_RON Currencies = 9
	Currencies_SEK Currencies = 10
	Currencies_CHF Currencies = 11
	Currencies_ISK Currencies = 12
	Currencies_NOK Currencies = 13
	Currencies_HRK Currencies = 14
	Currencies_RUB Currencies = 15
	Currencies_TRY Currencies = 16
	Currencies_AUD Currencies = 17
	Currencies_BRL Currencies = 18
	Currencies_CAD Currencies = 19
	Currencies_CNY Currencies = 20
	Currencies_HKD Currencies = 21
	Currencies_IDR Currencies = 22
	Currencies_ILS Currencies = 23
	Currencies_INR Currencies = 24
	Currencies_KRW Currencies = 25
	Currencies_MXN Currencies = 26
	Currencies_MYR Currencies = 27
	Currencies_NZD Currencies = 28
	Currencies_PHP Currencies = 29
	Currencies_SGD Currencies = 30
	Currencies_THB Currencies = 31
	Currencies_ZAR Currencies = 32
)

func (Currencies) Descriptor

func (Currencies) Descriptor() protoreflect.EnumDescriptor

func (Currencies) Enum

func (x Currencies) Enum() *Currencies

func (Currencies) EnumDescriptor deprecated

func (Currencies) EnumDescriptor() ([]byte, []int)

Deprecated: Use Currencies.Descriptor instead.

func (Currencies) Number

func (x Currencies) Number() protoreflect.EnumNumber

func (Currencies) String

func (x Currencies) String() string

func (Currencies) Type

type CurrencyClient

type CurrencyClient interface {
	GetRate(ctx context.Context, in *RateRequest, opts ...grpc.CallOption) (*RateResponse, error)
	SubscribeRate(ctx context.Context, opts ...grpc.CallOption) (Currency_SubscribeRateClient, error)
}

CurrencyClient is the client API for Currency service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewCurrencyClient

func NewCurrencyClient(cc grpc.ClientConnInterface) CurrencyClient

type CurrencyServer

type CurrencyServer interface {
	GetRate(context.Context, *RateRequest) (*RateResponse, error)
	SubscribeRate(Currency_SubscribeRateServer) error
}

CurrencyServer is the server API for Currency service. All implementations should embed UnimplementedCurrencyServer for forward compatibility

type Currency_SubscribeRateClient

type Currency_SubscribeRateClient interface {
	Send(*RateRequest) error
	Recv() (*RateResponse, error)
	grpc.ClientStream
}

type Currency_SubscribeRateServer

type Currency_SubscribeRateServer interface {
	Send(*RateResponse) error
	Recv() (*RateRequest, error)
	grpc.ServerStream
}

type RateRequest

type RateRequest struct {
	Base        Currencies `protobuf:"varint,1,opt,name=Base,proto3,enum=Currencies" json:"Base,omitempty"`
	Destination Currencies `protobuf:"varint,2,opt,name=Destination,proto3,enum=Currencies" json:"Destination,omitempty"`
	// contains filtered or unexported fields
}

func (*RateRequest) Descriptor deprecated

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

Deprecated: Use RateRequest.ProtoReflect.Descriptor instead.

func (*RateRequest) GetBase

func (x *RateRequest) GetBase() Currencies

func (*RateRequest) GetDestination

func (x *RateRequest) GetDestination() Currencies

func (*RateRequest) ProtoMessage

func (*RateRequest) ProtoMessage()

func (*RateRequest) ProtoReflect

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

func (*RateRequest) Reset

func (x *RateRequest) Reset()

func (*RateRequest) String

func (x *RateRequest) String() string

type RateResponse

type RateResponse struct {
	Base        Currencies `protobuf:"varint,1,opt,name=Base,proto3,enum=Currencies" json:"Base,omitempty"`
	Destination Currencies `protobuf:"varint,2,opt,name=Destination,proto3,enum=Currencies" json:"Destination,omitempty"`
	Rate        float64    `protobuf:"fixed64,3,opt,name=Rate,proto3" json:"Rate,omitempty"`
	// contains filtered or unexported fields
}

func (*RateResponse) Descriptor deprecated

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

Deprecated: Use RateResponse.ProtoReflect.Descriptor instead.

func (*RateResponse) GetBase

func (x *RateResponse) GetBase() Currencies

func (*RateResponse) GetDestination

func (x *RateResponse) GetDestination() Currencies

func (*RateResponse) GetRate

func (x *RateResponse) GetRate() float64

func (*RateResponse) ProtoMessage

func (*RateResponse) ProtoMessage()

func (*RateResponse) ProtoReflect

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

func (*RateResponse) Reset

func (x *RateResponse) Reset()

func (*RateResponse) String

func (x *RateResponse) String() string

type UnimplementedCurrencyServer

type UnimplementedCurrencyServer struct {
}

UnimplementedCurrencyServer should be embedded to have forward compatible implementations.

func (UnimplementedCurrencyServer) GetRate

func (UnimplementedCurrencyServer) SubscribeRate

type UnsafeCurrencyServer

type UnsafeCurrencyServer interface {
	// contains filtered or unexported methods
}

UnsafeCurrencyServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CurrencyServer will result in compilation errors.

Jump to

Keyboard shortcuts

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