currency

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetAllRatesResponse_Result_name = map[int32]string{
		0: "OK",
		1: "MISSING_DATA",
	}
	GetAllRatesResponse_Result_value = map[string]int32{
		"OK":           0,
		"MISSING_DATA": 1,
	}
)

Enum value maps for GetAllRatesResponse_Result.

View Source
var Currency_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "code.currency.v1.Currency",
	HandlerType: (*CurrencyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAllRates",
			Handler:    _Currency_GetAllRates_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "currency/v1/currency_service.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_v1_currency_service_proto protoreflect.FileDescriptor

Functions

func RegisterCurrencyServer

func RegisterCurrencyServer(s grpc.ServiceRegistrar, srv CurrencyServer)

Types

type CurrencyClient

type CurrencyClient interface {
	// GetAllRates returns the exchange rates for Kin against all available currencies
	GetAllRates(ctx context.Context, in *GetAllRatesRequest, opts ...grpc.CallOption) (*GetAllRatesResponse, 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 {
	// GetAllRates returns the exchange rates for Kin against all available currencies
	GetAllRates(context.Context, *GetAllRatesRequest) (*GetAllRatesResponse, error)
	// contains filtered or unexported methods
}

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

type GetAllRatesRequest

type GetAllRatesRequest struct {

	// If timestamp is included, the returned rate will be the most recent available
	// exchange rate prior to the provided timestamp within the same day. Otherwise,
	// the latest rates will be returned.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAllRatesRequest) Descriptor deprecated

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

Deprecated: Use GetAllRatesRequest.ProtoReflect.Descriptor instead.

func (*GetAllRatesRequest) GetTimestamp

func (x *GetAllRatesRequest) GetTimestamp() *timestamppb.Timestamp

func (*GetAllRatesRequest) ProtoMessage

func (*GetAllRatesRequest) ProtoMessage()

func (*GetAllRatesRequest) ProtoReflect

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

func (*GetAllRatesRequest) Reset

func (x *GetAllRatesRequest) Reset()

func (*GetAllRatesRequest) String

func (x *GetAllRatesRequest) String() string

func (*GetAllRatesRequest) Validate

func (m *GetAllRatesRequest) Validate() error

Validate checks the field values on GetAllRatesRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetAllRatesRequestValidationError

type GetAllRatesRequestValidationError struct {
	// contains filtered or unexported fields
}

GetAllRatesRequestValidationError is the validation error returned by GetAllRatesRequest.Validate if the designated constraints aren't met.

func (GetAllRatesRequestValidationError) Cause

Cause function returns cause value.

func (GetAllRatesRequestValidationError) Error

Error satisfies the builtin error interface

func (GetAllRatesRequestValidationError) ErrorName

ErrorName returns error name.

func (GetAllRatesRequestValidationError) Field

Field function returns field value.

func (GetAllRatesRequestValidationError) Key

Key function returns key value.

func (GetAllRatesRequestValidationError) Reason

Reason function returns reason value.

type GetAllRatesResponse

type GetAllRatesResponse struct {
	Result GetAllRatesResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=code.currency.v1.GetAllRatesResponse_Result" json:"result,omitempty"`
	// The time the exchange rates were observed
	AsOf *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=as_of,json=asOf,proto3" json:"as_of,omitempty"`
	// The price of 1 Kin in different currencies, keyed on 3- or 4- letter lowercase currency code.
	Rates map[string]float64 `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetAllRatesResponse) Descriptor deprecated

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

Deprecated: Use GetAllRatesResponse.ProtoReflect.Descriptor instead.

func (*GetAllRatesResponse) GetAsOf

func (*GetAllRatesResponse) GetRates

func (x *GetAllRatesResponse) GetRates() map[string]float64

func (*GetAllRatesResponse) GetResult

func (*GetAllRatesResponse) ProtoMessage

func (*GetAllRatesResponse) ProtoMessage()

func (*GetAllRatesResponse) ProtoReflect

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

func (*GetAllRatesResponse) Reset

func (x *GetAllRatesResponse) Reset()

func (*GetAllRatesResponse) String

func (x *GetAllRatesResponse) String() string

func (*GetAllRatesResponse) Validate

func (m *GetAllRatesResponse) Validate() error

Validate checks the field values on GetAllRatesResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetAllRatesResponseValidationError

type GetAllRatesResponseValidationError struct {
	// contains filtered or unexported fields
}

GetAllRatesResponseValidationError is the validation error returned by GetAllRatesResponse.Validate if the designated constraints aren't met.

func (GetAllRatesResponseValidationError) Cause

Cause function returns cause value.

func (GetAllRatesResponseValidationError) Error

Error satisfies the builtin error interface

func (GetAllRatesResponseValidationError) ErrorName

ErrorName returns error name.

func (GetAllRatesResponseValidationError) Field

Field function returns field value.

func (GetAllRatesResponseValidationError) Key

Key function returns key value.

func (GetAllRatesResponseValidationError) Reason

Reason function returns reason value.

type GetAllRatesResponse_Result

type GetAllRatesResponse_Result int32
const (
	GetAllRatesResponse_OK GetAllRatesResponse_Result = 0
	// No currency data is available for the requested timestamp.
	GetAllRatesResponse_MISSING_DATA GetAllRatesResponse_Result = 1
)

func (GetAllRatesResponse_Result) Descriptor

func (GetAllRatesResponse_Result) Enum

func (GetAllRatesResponse_Result) EnumDescriptor deprecated

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

Deprecated: Use GetAllRatesResponse_Result.Descriptor instead.

func (GetAllRatesResponse_Result) Number

func (GetAllRatesResponse_Result) String

func (GetAllRatesResponse_Result) Type

type UnimplementedCurrencyServer

type UnimplementedCurrencyServer struct {
}

UnimplementedCurrencyServer must be embedded to have forward compatible implementations.

func (UnimplementedCurrencyServer) GetAllRates

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