Documentation
¶
Index ¶
- Variables
- func RegisterCurrencyServer(s *grpc.Server, srv CurrencyServer)
- type Currencies
- type CurrencyClient
- type CurrencyServer
- type RateRequest
- func (*RateRequest) Descriptor() ([]byte, []int)
- func (m *RateRequest) GetBase() Currencies
- func (m *RateRequest) GetDestination() Currencies
- func (*RateRequest) ProtoMessage()
- func (m *RateRequest) Reset()
- func (m *RateRequest) String() string
- func (m *RateRequest) XXX_DiscardUnknown()
- func (m *RateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RateRequest) XXX_Merge(src proto.Message)
- func (m *RateRequest) XXX_Size() int
- func (m *RateRequest) XXX_Unmarshal(b []byte) error
- type RateResponse
- func (*RateResponse) Descriptor() ([]byte, []int)
- func (m *RateResponse) GetRate() float32
- func (*RateResponse) ProtoMessage()
- func (m *RateResponse) Reset()
- func (m *RateResponse) String() string
- func (m *RateResponse) XXX_DiscardUnknown()
- func (m *RateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RateResponse) XXX_Merge(src proto.Message)
- func (m *RateResponse) XXX_Size() int
- func (m *RateResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedCurrencyServer
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",
}
View Source
var 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,
}
Functions ¶
func RegisterCurrencyServer ¶
func RegisterCurrencyServer(s *grpc.Server, 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) EnumDescriptor ¶
func (Currencies) EnumDescriptor() ([]byte, []int)
func (Currencies) String ¶
func (x Currencies) String() string
type CurrencyClient ¶
type CurrencyClient interface { // GetRate returns the exchange rate for the two provided currency codes GetRate(ctx context.Context, in *RateRequest, opts ...grpc.CallOption) (*RateResponse, error) }
CurrencyClient is the client API for Currency service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCurrencyClient ¶
func NewCurrencyClient(cc grpc.ClientConnInterface) CurrencyClient
type CurrencyServer ¶
type CurrencyServer interface { // GetRate returns the exchange rate for the two provided currency codes GetRate(context.Context, *RateRequest) (*RateResponse, error) }
CurrencyServer is the server API for Currency service.
type RateRequest ¶
type RateRequest struct { // Base is the base currency code for the rate Base Currencies `protobuf:"varint,1,opt,name=Base,proto3,enum=Currencies" json:"Base,omitempty"` // Destination is the destination currency code for the rate Destination Currencies `protobuf:"varint,2,opt,name=Destination,proto3,enum=Currencies" json:"Destination,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
RateRequest defines the request for a GetRate call
func (*RateRequest) Descriptor ¶
func (*RateRequest) Descriptor() ([]byte, []int)
func (*RateRequest) GetBase ¶
func (m *RateRequest) GetBase() Currencies
func (*RateRequest) GetDestination ¶
func (m *RateRequest) GetDestination() Currencies
func (*RateRequest) ProtoMessage ¶
func (*RateRequest) ProtoMessage()
func (*RateRequest) Reset ¶
func (m *RateRequest) Reset()
func (*RateRequest) String ¶
func (m *RateRequest) String() string
func (*RateRequest) XXX_DiscardUnknown ¶
func (m *RateRequest) XXX_DiscardUnknown()
func (*RateRequest) XXX_Marshal ¶
func (m *RateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RateRequest) XXX_Merge ¶
func (m *RateRequest) XXX_Merge(src proto.Message)
func (*RateRequest) XXX_Size ¶
func (m *RateRequest) XXX_Size() int
func (*RateRequest) XXX_Unmarshal ¶
func (m *RateRequest) XXX_Unmarshal(b []byte) error
type RateResponse ¶
type RateResponse struct { Rate float32 `protobuf:"fixed32,1,opt,name=Rate,proto3" json:"Rate,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
RateResponse is the response from a GetRate call, it contains rate which is a floating point number and can be used to convert between the two currencies specified in the request.
func (*RateResponse) Descriptor ¶
func (*RateResponse) Descriptor() ([]byte, []int)
func (*RateResponse) GetRate ¶
func (m *RateResponse) GetRate() float32
func (*RateResponse) ProtoMessage ¶
func (*RateResponse) ProtoMessage()
func (*RateResponse) Reset ¶
func (m *RateResponse) Reset()
func (*RateResponse) String ¶
func (m *RateResponse) String() string
func (*RateResponse) XXX_DiscardUnknown ¶
func (m *RateResponse) XXX_DiscardUnknown()
func (*RateResponse) XXX_Marshal ¶
func (m *RateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RateResponse) XXX_Merge ¶
func (m *RateResponse) XXX_Merge(src proto.Message)
func (*RateResponse) XXX_Size ¶
func (m *RateResponse) XXX_Size() int
func (*RateResponse) XXX_Unmarshal ¶
func (m *RateResponse) XXX_Unmarshal(b []byte) error
type UnimplementedCurrencyServer ¶
type UnimplementedCurrencyServer struct { }
UnimplementedCurrencyServer can be embedded to have forward compatible implementations.
func (*UnimplementedCurrencyServer) GetRate ¶
func (*UnimplementedCurrencyServer) GetRate(ctx context.Context, req *RateRequest) (*RateResponse, error)
Click to show internal directories.
Click to hide internal directories.