grpcservice

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Exchanger_MakeExchange_FullMethodName = "/grpcservice.Exchanger/MakeExchange"
	Exchanger_Subscriber_FullMethodName   = "/grpcservice.Exchanger/Subscriber"
)

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: "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",
	}
	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,
		"TRY": 15,
		"AUD": 16,
		"BRL": 17,
		"CAD": 18,
		"CNY": 19,
		"HKD": 20,
		"IDR": 21,
		"ILS": 22,
		"INR": 23,
		"KRW": 24,
		"MXN": 25,
		"MYR": 26,
		"NZD": 27,
		"PHP": 28,
		"SGD": 29,
		"THB": 30,
		"ZAR": 31,
	}
)

Enum value maps for Currencies.

View Source
var Exchanger_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpcservice.Exchanger",
	HandlerType: (*ExchangerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "MakeExchange",
			Handler:    _Exchanger_MakeExchange_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscriber",
			Handler:       _Exchanger_Subscriber_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/exchanger.proto",
}

Exchanger_ServiceDesc is the grpc.ServiceDesc for Exchanger 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_proto_exchanger_proto protoreflect.FileDescriptor

Functions

func RegisterExchangerServer

func RegisterExchangerServer(s grpc.ServiceRegistrar, srv ExchangerServer)

Types

type Currencies

type Currencies int32
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_TRY Currencies = 15
	Currencies_AUD Currencies = 16
	Currencies_BRL Currencies = 17
	Currencies_CAD Currencies = 18
	Currencies_CNY Currencies = 19
	Currencies_HKD Currencies = 20
	Currencies_IDR Currencies = 21
	Currencies_ILS Currencies = 22
	Currencies_INR Currencies = 23
	Currencies_KRW Currencies = 24
	Currencies_MXN Currencies = 25
	Currencies_MYR Currencies = 26
	Currencies_NZD Currencies = 27
	Currencies_PHP Currencies = 28
	Currencies_SGD Currencies = 29
	Currencies_THB Currencies = 30
	Currencies_ZAR Currencies = 31
)

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 ExchangeRequest

type ExchangeRequest struct {
	From Currencies `protobuf:"varint,1,opt,name=From,proto3,enum=grpcservice.Currencies" json:"From,omitempty"`
	To   Currencies `protobuf:"varint,2,opt,name=To,proto3,enum=grpcservice.Currencies" json:"To,omitempty"`
	// contains filtered or unexported fields
}

func (*ExchangeRequest) Descriptor deprecated

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

Deprecated: Use ExchangeRequest.ProtoReflect.Descriptor instead.

func (*ExchangeRequest) GetFrom

func (x *ExchangeRequest) GetFrom() Currencies

func (*ExchangeRequest) GetTo

func (x *ExchangeRequest) GetTo() Currencies

func (*ExchangeRequest) ProtoMessage

func (*ExchangeRequest) ProtoMessage()

func (*ExchangeRequest) ProtoReflect

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

func (*ExchangeRequest) Reset

func (x *ExchangeRequest) Reset()

func (*ExchangeRequest) String

func (x *ExchangeRequest) String() string

type ExchangeResponse

type ExchangeResponse struct {
	Rate      float64                `protobuf:"fixed64,1,opt,name=rate,proto3" json:"rate,omitempty"`
	From      Currencies             `protobuf:"varint,2,opt,name=from,proto3,enum=grpcservice.Currencies" json:"from,omitempty"`
	To        Currencies             `protobuf:"varint,3,opt,name=to,proto3,enum=grpcservice.Currencies" json:"to,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	// contains filtered or unexported fields
}

func (*ExchangeResponse) Descriptor deprecated

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

Deprecated: Use ExchangeResponse.ProtoReflect.Descriptor instead.

func (*ExchangeResponse) GetCreatedAt

func (x *ExchangeResponse) GetCreatedAt() *timestamppb.Timestamp

func (*ExchangeResponse) GetFrom

func (x *ExchangeResponse) GetFrom() Currencies

func (*ExchangeResponse) GetRate

func (x *ExchangeResponse) GetRate() float64

func (*ExchangeResponse) GetTo

func (x *ExchangeResponse) GetTo() Currencies

func (*ExchangeResponse) ProtoMessage

func (*ExchangeResponse) ProtoMessage()

func (*ExchangeResponse) ProtoReflect

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

func (*ExchangeResponse) Reset

func (x *ExchangeResponse) Reset()

func (*ExchangeResponse) String

func (x *ExchangeResponse) String() string

type ExchangerClient

type ExchangerClient interface {
	MakeExchange(ctx context.Context, in *ExchangeRequest, opts ...grpc.CallOption) (*ExchangeResponse, error)
	// allows a client to subscribe for changes when the rate changes a response will be sent
	Subscriber(ctx context.Context, opts ...grpc.CallOption) (Exchanger_SubscriberClient, error)
}

ExchangerClient is the client API for Exchanger 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 NewExchangerClient

func NewExchangerClient(cc grpc.ClientConnInterface) ExchangerClient

type ExchangerServer

type ExchangerServer interface {
	MakeExchange(context.Context, *ExchangeRequest) (*ExchangeResponse, error)
	// allows a client to subscribe for changes when the rate changes a response will be sent
	Subscriber(Exchanger_SubscriberServer) error
}

ExchangerServer is the server API for Exchanger service. All implementations should embed UnimplementedExchangerServer for forward compatibility

type Exchanger_SubscriberClient

type Exchanger_SubscriberClient interface {
	Send(*ExchangeRequest) error
	Recv() (*StreamExchangeResponse, error)
	grpc.ClientStream
}

type Exchanger_SubscriberServer

type Exchanger_SubscriberServer interface {
	Send(*StreamExchangeResponse) error
	Recv() (*ExchangeRequest, error)
	grpc.ServerStream
}

type StreamExchangeResponse

type StreamExchangeResponse struct {

	// Types that are assignable to Message:
	//
	//	*StreamExchangeResponse_ExchangeResponse
	//	*StreamExchangeResponse_Error
	Message isStreamExchangeResponse_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

func (*StreamExchangeResponse) Descriptor deprecated

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

Deprecated: Use StreamExchangeResponse.ProtoReflect.Descriptor instead.

func (*StreamExchangeResponse) GetError

func (x *StreamExchangeResponse) GetError() *status.Status

func (*StreamExchangeResponse) GetExchangeResponse

func (x *StreamExchangeResponse) GetExchangeResponse() *ExchangeResponse

func (*StreamExchangeResponse) GetMessage

func (m *StreamExchangeResponse) GetMessage() isStreamExchangeResponse_Message

func (*StreamExchangeResponse) ProtoMessage

func (*StreamExchangeResponse) ProtoMessage()

func (*StreamExchangeResponse) ProtoReflect

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

func (*StreamExchangeResponse) Reset

func (x *StreamExchangeResponse) Reset()

func (*StreamExchangeResponse) String

func (x *StreamExchangeResponse) String() string

type StreamExchangeResponse_Error

type StreamExchangeResponse_Error struct {
	Error *status.Status `protobuf:"bytes,2,opt,name=error,proto3,oneof"`
}

type StreamExchangeResponse_ExchangeResponse

type StreamExchangeResponse_ExchangeResponse struct {
	ExchangeResponse *ExchangeResponse `protobuf:"bytes,1,opt,name=exchangeResponse,proto3,oneof"`
}

type UnimplementedExchangerServer

type UnimplementedExchangerServer struct {
}

UnimplementedExchangerServer should be embedded to have forward compatible implementations.

func (UnimplementedExchangerServer) MakeExchange

func (UnimplementedExchangerServer) Subscriber

type UnsafeExchangerServer

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

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

Jump to

Keyboard shortcuts

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