protos

package
v0.0.0-...-0fc5d1f Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Currencies_name = map[int32]string{
		0: "KSH",
		1: "UGS",
		2: "TSH",
		3: "SSH",
		4: "USD",
		5: "EUR",
		6: "GBP",
		7: "YEN",
		8: "YUN",
	}
	Currencies_value = map[string]int32{
		"KSH": 0,
		"UGS": 1,
		"TSH": 2,
		"SSH": 3,
		"USD": 4,
		"EUR": 5,
		"GBP": 6,
		"YEN": 7,
		"YUN": 8,
	}
)

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{},
	Metadata: "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_currency_proto protoreflect.FileDescriptor

Functions

func RegisterCurrencyServer

func RegisterCurrencyServer(s grpc.ServiceRegistrar, srv CurrencyServer)

Types

type Currencies

type Currencies int32
const (
	Currencies_KSH Currencies = 0
	Currencies_UGS Currencies = 1
	Currencies_TSH Currencies = 2
	Currencies_SSH Currencies = 3
	Currencies_USD Currencies = 4
	Currencies_EUR Currencies = 5
	Currencies_GBP Currencies = 6
	Currencies_YEN Currencies = 7
	Currencies_YUN Currencies = 8
)

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 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://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 returns the exchange rate for the two provided currency codes
	GetRate(context.Context, *RateRequest) (*RateResponse, error)
}

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

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"`
	// contains filtered or unexported fields
}

RateRequest defines the request for a GetRate call

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 {
	Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"`
	// contains filtered or unexported fields
}

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 deprecated

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

Deprecated: Use RateResponse.ProtoReflect.Descriptor instead.

func (*RateResponse) GetRate

func (x *RateResponse) GetRate() float32

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

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