Documentation ¶
Index ¶
- Variables
- func NewExchangeRatesEndpoints() []*api.Endpoint
- func RegisterExchangeRatesHandler(s server.Server, hdlr ExchangeRatesHandler, opts ...server.HandlerOption) error
- func RegisterExchangeRatesServer(s grpc.ServiceRegistrar, srv ExchangeRatesServer)
- type Currency
- type CurrencyRate
- func (*CurrencyRate) Descriptor() ([]byte, []int)deprecated
- func (x *CurrencyRate) GetDate() string
- func (x *CurrencyRate) GetDestination() string
- func (x *CurrencyRate) GetInverse() float32
- func (x *CurrencyRate) GetRate() float32
- func (*CurrencyRate) ProtoMessage()
- func (x *CurrencyRate) ProtoReflect() protoreflect.Message
- func (x *CurrencyRate) Reset()
- func (x *CurrencyRate) String() string
- type CurrencyRateRequest
- func (*CurrencyRateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CurrencyRateRequest) GetBase() string
- func (x *CurrencyRateRequest) GetDestination() string
- func (*CurrencyRateRequest) ProtoMessage()
- func (x *CurrencyRateRequest) ProtoReflect() protoreflect.Message
- func (x *CurrencyRateRequest) Reset()
- func (x *CurrencyRateRequest) String() string
- type CurrencyRateResponse
- func (*CurrencyRateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CurrencyRateResponse) GetRate() *CurrencyRate
- func (*CurrencyRateResponse) ProtoMessage()
- func (x *CurrencyRateResponse) ProtoReflect() protoreflect.Message
- func (x *CurrencyRateResponse) Reset()
- func (x *CurrencyRateResponse) String() string
- type ExchangeRatesClient
- type ExchangeRatesHandler
- type ExchangeRatesServer
- type ExchangeRatesService
- type ExchangeRates_SubscriptionClient
- type ExchangeRates_SubscriptionServer
- type ExchangeRates_SubscriptionService
- type ExchangeRates_SubscriptionStream
- type ListCurrencyRequest
- func (*ListCurrencyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListCurrencyRequest) GetPageIndex() *wrapperspb.Int32Value
- func (x *ListCurrencyRequest) GetPageSize() *wrapperspb.Int32Value
- func (*ListCurrencyRequest) ProtoMessage()
- func (x *ListCurrencyRequest) ProtoReflect() protoreflect.Message
- func (x *ListCurrencyRequest) Reset()
- func (x *ListCurrencyRequest) String() string
- type ListCurrencyResponse
- func (*ListCurrencyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListCurrencyResponse) GetData() []*Currency
- func (x *ListCurrencyResponse) GetPageIndex() *wrapperspb.Int32Value
- func (x *ListCurrencyResponse) GetPageSize() *wrapperspb.Int32Value
- func (x *ListCurrencyResponse) GetTotal() *wrapperspb.Int32Value
- func (*ListCurrencyResponse) ProtoMessage()
- func (x *ListCurrencyResponse) ProtoReflect() protoreflect.Message
- func (x *ListCurrencyResponse) Reset()
- func (x *ListCurrencyResponse) String() string
- type ListRatesRequest
- type ListRatesResponse
- func (*ListRatesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListRatesResponse) GetBase() string
- func (x *ListRatesResponse) GetData() []*CurrencyRate
- func (x *ListRatesResponse) GetDate() string
- func (*ListRatesResponse) ProtoMessage()
- func (x *ListRatesResponse) ProtoReflect() protoreflect.Message
- func (x *ListRatesResponse) Reset()
- func (x *ListRatesResponse) String() string
- type StreamResponse
- func (*StreamResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StreamResponse) GetError() *anypb.Any
- func (m *StreamResponse) GetMessage() isStreamResponse_Message
- func (x *StreamResponse) GetRateResponse() *ListRatesResponse
- func (*StreamResponse) ProtoMessage()
- func (x *StreamResponse) ProtoReflect() protoreflect.Message
- func (x *StreamResponse) Reset()
- func (x *StreamResponse) String() string
- type StreamResponse_Error
- type StreamResponse_RateResponse
- type UnimplementedExchangeRatesServer
- func (UnimplementedExchangeRatesServer) GetRate(context.Context, *CurrencyRateRequest) (*CurrencyRateResponse, error)
- func (UnimplementedExchangeRatesServer) ListCurrencies(context.Context, *ListCurrencyRequest) (*ListCurrencyResponse, error)
- func (UnimplementedExchangeRatesServer) ListRates(context.Context, *ListRatesRequest) (*ListRatesResponse, error)
- func (UnimplementedExchangeRatesServer) Subscription(ExchangeRates_SubscriptionServer) error
- type UnsafeExchangeRatesServer
Constants ¶
This section is empty.
Variables ¶
var ExchangeRates_ServiceDesc = grpc.ServiceDesc{ ServiceName: "exchange_rate.ExchangeRates", HandlerType: (*ExchangeRatesServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetRate", Handler: _ExchangeRates_GetRate_Handler, }, { MethodName: "ListCurrencies", Handler: _ExchangeRates_ListCurrencies_Handler, }, { MethodName: "ListRates", Handler: _ExchangeRates_ListRates_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Subscription", Handler: _ExchangeRates_Subscription_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/exchange_rate.proto", }
ExchangeRates_ServiceDesc is the grpc.ServiceDesc for ExchangeRates service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_exchange_rate_proto protoreflect.FileDescriptor
Functions ¶
func RegisterExchangeRatesHandler ¶
func RegisterExchangeRatesHandler(s server.Server, hdlr ExchangeRatesHandler, opts ...server.HandlerOption) error
func RegisterExchangeRatesServer ¶
func RegisterExchangeRatesServer(s grpc.ServiceRegistrar, srv ExchangeRatesServer)
Types ¶
type Currency ¶
type Currency struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*Currency) Descriptor
deprecated
func (*Currency) GetDescription ¶
func (*Currency) ProtoMessage ¶
func (*Currency) ProtoMessage()
func (*Currency) ProtoReflect ¶
func (x *Currency) ProtoReflect() protoreflect.Message
type CurrencyRate ¶
type CurrencyRate struct { Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` Rate float32 `protobuf:"fixed32,3,opt,name=rate,proto3" json:"rate,omitempty"` Inverse float32 `protobuf:"fixed32,4,opt,name=inverse,proto3" json:"inverse,omitempty"` Date string `protobuf:"bytes,5,opt,name=date,proto3" json:"date,omitempty"` // contains filtered or unexported fields }
func (*CurrencyRate) Descriptor
deprecated
func (*CurrencyRate) Descriptor() ([]byte, []int)
Deprecated: Use CurrencyRate.ProtoReflect.Descriptor instead.
func (*CurrencyRate) GetDate ¶
func (x *CurrencyRate) GetDate() string
func (*CurrencyRate) GetDestination ¶
func (x *CurrencyRate) GetDestination() string
func (*CurrencyRate) GetInverse ¶
func (x *CurrencyRate) GetInverse() float32
func (*CurrencyRate) GetRate ¶
func (x *CurrencyRate) GetRate() float32
func (*CurrencyRate) ProtoMessage ¶
func (*CurrencyRate) ProtoMessage()
func (*CurrencyRate) ProtoReflect ¶
func (x *CurrencyRate) ProtoReflect() protoreflect.Message
func (*CurrencyRate) Reset ¶
func (x *CurrencyRate) Reset()
func (*CurrencyRate) String ¶
func (x *CurrencyRate) String() string
type CurrencyRateRequest ¶
type CurrencyRateRequest struct { Base string `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` // contains filtered or unexported fields }
RateRequest convert from base to destination
func (*CurrencyRateRequest) Descriptor
deprecated
func (*CurrencyRateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CurrencyRateRequest.ProtoReflect.Descriptor instead.
func (*CurrencyRateRequest) GetBase ¶
func (x *CurrencyRateRequest) GetBase() string
func (*CurrencyRateRequest) GetDestination ¶
func (x *CurrencyRateRequest) GetDestination() string
func (*CurrencyRateRequest) ProtoMessage ¶
func (*CurrencyRateRequest) ProtoMessage()
func (*CurrencyRateRequest) ProtoReflect ¶
func (x *CurrencyRateRequest) ProtoReflect() protoreflect.Message
func (*CurrencyRateRequest) Reset ¶
func (x *CurrencyRateRequest) Reset()
func (*CurrencyRateRequest) String ¶
func (x *CurrencyRateRequest) String() string
type CurrencyRateResponse ¶
type CurrencyRateResponse struct { Rate *CurrencyRate `protobuf:"bytes,1,opt,name=rate,proto3" json:"rate,omitempty"` // contains filtered or unexported fields }
func (*CurrencyRateResponse) Descriptor
deprecated
func (*CurrencyRateResponse) Descriptor() ([]byte, []int)
Deprecated: Use CurrencyRateResponse.ProtoReflect.Descriptor instead.
func (*CurrencyRateResponse) GetRate ¶
func (x *CurrencyRateResponse) GetRate() *CurrencyRate
func (*CurrencyRateResponse) ProtoMessage ¶
func (*CurrencyRateResponse) ProtoMessage()
func (*CurrencyRateResponse) ProtoReflect ¶
func (x *CurrencyRateResponse) ProtoReflect() protoreflect.Message
func (*CurrencyRateResponse) Reset ¶
func (x *CurrencyRateResponse) Reset()
func (*CurrencyRateResponse) String ¶
func (x *CurrencyRateResponse) String() string
type ExchangeRatesClient ¶
type ExchangeRatesClient interface { GetRate(ctx context.Context, in *CurrencyRateRequest, opts ...grpc.CallOption) (*CurrencyRateResponse, error) // ListCurrencies returns a list of all currencies ListCurrencies(ctx context.Context, in *ListCurrencyRequest, opts ...grpc.CallOption) (*ListCurrencyResponse, error) // ListRates returns the exchange rates of other currencies based on the base currency ListRates(ctx context.Context, in *ListRatesRequest, opts ...grpc.CallOption) (*ListRatesResponse, error) // Subscription bidirectional streaming service to get updated rates Subscription(ctx context.Context, opts ...grpc.CallOption) (ExchangeRates_SubscriptionClient, error) }
ExchangeRatesClient is the client API for ExchangeRates 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 NewExchangeRatesClient ¶
func NewExchangeRatesClient(cc grpc.ClientConnInterface) ExchangeRatesClient
type ExchangeRatesHandler ¶
type ExchangeRatesHandler interface { GetRate(context.Context, *CurrencyRateRequest, *CurrencyRateResponse) error // ListCurrencies returns a list of all currencies ListCurrencies(context.Context, *ListCurrencyRequest, *ListCurrencyResponse) error // ListRates returns the exchange rates of other currencies based on the base currency ListRates(context.Context, *ListRatesRequest, *ListRatesResponse) error // Subscription bidirectional streaming service to get updated rates Subscription(context.Context, ExchangeRates_SubscriptionStream) error }
type ExchangeRatesServer ¶
type ExchangeRatesServer interface { GetRate(context.Context, *CurrencyRateRequest) (*CurrencyRateResponse, error) // ListCurrencies returns a list of all currencies ListCurrencies(context.Context, *ListCurrencyRequest) (*ListCurrencyResponse, error) // ListRates returns the exchange rates of other currencies based on the base currency ListRates(context.Context, *ListRatesRequest) (*ListRatesResponse, error) // Subscription bidirectional streaming service to get updated rates Subscription(ExchangeRates_SubscriptionServer) error // contains filtered or unexported methods }
ExchangeRatesServer is the server API for ExchangeRates service. All implementations must embed UnimplementedExchangeRatesServer for forward compatibility
type ExchangeRatesService ¶
type ExchangeRatesService interface { GetRate(ctx context.Context, in *CurrencyRateRequest, opts ...client.CallOption) (*CurrencyRateResponse, error) // ListCurrencies returns a list of all currencies ListCurrencies(ctx context.Context, in *ListCurrencyRequest, opts ...client.CallOption) (*ListCurrencyResponse, error) // ListRates returns the exchange rates of other currencies based on the base currency ListRates(ctx context.Context, in *ListRatesRequest, opts ...client.CallOption) (*ListRatesResponse, error) // Subscription bidirectional streaming service to get updated rates Subscription(ctx context.Context, opts ...client.CallOption) (ExchangeRates_SubscriptionService, error) }
func NewExchangeRatesService ¶
func NewExchangeRatesService(name string, c client.Client) ExchangeRatesService
type ExchangeRates_SubscriptionClient ¶
type ExchangeRates_SubscriptionClient interface { Send(*ListRatesRequest) error Recv() (*ListRatesResponse, error) grpc.ClientStream }
type ExchangeRates_SubscriptionServer ¶
type ExchangeRates_SubscriptionServer interface { Send(*ListRatesResponse) error Recv() (*ListRatesRequest, error) grpc.ServerStream }
type ExchangeRates_SubscriptionService ¶
type ExchangeRates_SubscriptionService interface { Context() context.Context SendMsg(interface{}) error RecvMsg(interface{}) error Close() error Send(*ListRatesRequest) error Recv() (*ListRatesResponse, error) }
type ExchangeRates_SubscriptionStream ¶
type ExchangeRates_SubscriptionStream interface { Context() context.Context SendMsg(interface{}) error RecvMsg(interface{}) error Close() error Send(*ListRatesResponse) error Recv() (*ListRatesRequest, error) }
type ListCurrencyRequest ¶
type ListCurrencyRequest struct { PageIndex *wrapperspb.Int32Value `protobuf:"bytes,1,opt,name=pageIndex,proto3" json:"pageIndex,omitempty"` PageSize *wrapperspb.Int32Value `protobuf:"bytes,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` // contains filtered or unexported fields }
RatesRequest g
func (*ListCurrencyRequest) Descriptor
deprecated
func (*ListCurrencyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListCurrencyRequest.ProtoReflect.Descriptor instead.
func (*ListCurrencyRequest) GetPageIndex ¶
func (x *ListCurrencyRequest) GetPageIndex() *wrapperspb.Int32Value
func (*ListCurrencyRequest) GetPageSize ¶
func (x *ListCurrencyRequest) GetPageSize() *wrapperspb.Int32Value
func (*ListCurrencyRequest) ProtoMessage ¶
func (*ListCurrencyRequest) ProtoMessage()
func (*ListCurrencyRequest) ProtoReflect ¶
func (x *ListCurrencyRequest) ProtoReflect() protoreflect.Message
func (*ListCurrencyRequest) Reset ¶
func (x *ListCurrencyRequest) Reset()
func (*ListCurrencyRequest) String ¶
func (x *ListCurrencyRequest) String() string
type ListCurrencyResponse ¶
type ListCurrencyResponse struct { PageIndex *wrapperspb.Int32Value `protobuf:"bytes,1,opt,name=pageIndex,proto3" json:"pageIndex,omitempty"` PageSize *wrapperspb.Int32Value `protobuf:"bytes,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` Total *wrapperspb.Int32Value `protobuf:"bytes,3,opt,name=total,proto3" json:"total,omitempty"` Data []*Currency `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ListCurrencyResponse) Descriptor
deprecated
func (*ListCurrencyResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListCurrencyResponse.ProtoReflect.Descriptor instead.
func (*ListCurrencyResponse) GetData ¶
func (x *ListCurrencyResponse) GetData() []*Currency
func (*ListCurrencyResponse) GetPageIndex ¶
func (x *ListCurrencyResponse) GetPageIndex() *wrapperspb.Int32Value
func (*ListCurrencyResponse) GetPageSize ¶
func (x *ListCurrencyResponse) GetPageSize() *wrapperspb.Int32Value
func (*ListCurrencyResponse) GetTotal ¶
func (x *ListCurrencyResponse) GetTotal() *wrapperspb.Int32Value
func (*ListCurrencyResponse) ProtoMessage ¶
func (*ListCurrencyResponse) ProtoMessage()
func (*ListCurrencyResponse) ProtoReflect ¶
func (x *ListCurrencyResponse) ProtoReflect() protoreflect.Message
func (*ListCurrencyResponse) Reset ¶
func (x *ListCurrencyResponse) Reset()
func (*ListCurrencyResponse) String ¶
func (x *ListCurrencyResponse) String() string
type ListRatesRequest ¶
type ListRatesRequest struct { Base string `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` // contains filtered or unexported fields }
BaseRateRequest get base currency rates
func (*ListRatesRequest) Descriptor
deprecated
func (*ListRatesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRatesRequest.ProtoReflect.Descriptor instead.
func (*ListRatesRequest) GetBase ¶
func (x *ListRatesRequest) GetBase() string
func (*ListRatesRequest) ProtoMessage ¶
func (*ListRatesRequest) ProtoMessage()
func (*ListRatesRequest) ProtoReflect ¶
func (x *ListRatesRequest) ProtoReflect() protoreflect.Message
func (*ListRatesRequest) Reset ¶
func (x *ListRatesRequest) Reset()
func (*ListRatesRequest) String ¶
func (x *ListRatesRequest) String() string
type ListRatesResponse ¶
type ListRatesResponse struct { Base string `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"` Data []*CurrencyRate `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ListRatesResponse) Descriptor
deprecated
func (*ListRatesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListRatesResponse.ProtoReflect.Descriptor instead.
func (*ListRatesResponse) GetBase ¶
func (x *ListRatesResponse) GetBase() string
func (*ListRatesResponse) GetData ¶
func (x *ListRatesResponse) GetData() []*CurrencyRate
func (*ListRatesResponse) GetDate ¶
func (x *ListRatesResponse) GetDate() string
func (*ListRatesResponse) ProtoMessage ¶
func (*ListRatesResponse) ProtoMessage()
func (*ListRatesResponse) ProtoReflect ¶
func (x *ListRatesResponse) ProtoReflect() protoreflect.Message
func (*ListRatesResponse) Reset ¶
func (x *ListRatesResponse) Reset()
func (*ListRatesResponse) String ¶
func (x *ListRatesResponse) String() string
type StreamResponse ¶
type StreamResponse struct { // Types that are assignable to Message: // // *StreamResponse_RateResponse // *StreamResponse_Error Message isStreamResponse_Message `protobuf_oneof:"message"` // contains filtered or unexported fields }
func (*StreamResponse) Descriptor
deprecated
func (*StreamResponse) Descriptor() ([]byte, []int)
Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead.
func (*StreamResponse) GetError ¶
func (x *StreamResponse) GetError() *anypb.Any
func (*StreamResponse) GetMessage ¶
func (m *StreamResponse) GetMessage() isStreamResponse_Message
func (*StreamResponse) GetRateResponse ¶
func (x *StreamResponse) GetRateResponse() *ListRatesResponse
func (*StreamResponse) ProtoMessage ¶
func (*StreamResponse) ProtoMessage()
func (*StreamResponse) ProtoReflect ¶
func (x *StreamResponse) ProtoReflect() protoreflect.Message
func (*StreamResponse) Reset ¶
func (x *StreamResponse) Reset()
func (*StreamResponse) String ¶
func (x *StreamResponse) String() string
type StreamResponse_Error ¶
type StreamResponse_RateResponse ¶
type StreamResponse_RateResponse struct {
RateResponse *ListRatesResponse `protobuf:"bytes,1,opt,name=rateResponse,proto3,oneof"`
}
type UnimplementedExchangeRatesServer ¶
type UnimplementedExchangeRatesServer struct { }
UnimplementedExchangeRatesServer must be embedded to have forward compatible implementations.
func (UnimplementedExchangeRatesServer) GetRate ¶
func (UnimplementedExchangeRatesServer) GetRate(context.Context, *CurrencyRateRequest) (*CurrencyRateResponse, error)
func (UnimplementedExchangeRatesServer) ListCurrencies ¶
func (UnimplementedExchangeRatesServer) ListCurrencies(context.Context, *ListCurrencyRequest) (*ListCurrencyResponse, error)
func (UnimplementedExchangeRatesServer) ListRates ¶
func (UnimplementedExchangeRatesServer) ListRates(context.Context, *ListRatesRequest) (*ListRatesResponse, error)
func (UnimplementedExchangeRatesServer) Subscription ¶
func (UnimplementedExchangeRatesServer) Subscription(ExchangeRates_SubscriptionServer) error
type UnsafeExchangeRatesServer ¶
type UnsafeExchangeRatesServer interface {
// contains filtered or unexported methods
}
UnsafeExchangeRatesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExchangeRatesServer will result in compilation errors.