types

package
v0.0.0-...-268bfc8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Aggregator_Aggregate_FullMethodName  = "/Aggregator/Aggregate"
	Aggregator_GetInvoice_FullMethodName = "/Aggregator/GetInvoice"
)

Variables

View Source
var Aggregator_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Aggregator",
	HandlerType: (*AggregatorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Aggregate",
			Handler:    _Aggregator_Aggregate_Handler,
		},
		{
			MethodName: "GetInvoice",
			Handler:    _Aggregator_GetInvoice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "types/ptypes.proto",
}

Aggregator_ServiceDesc is the grpc.ServiceDesc for Aggregator 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_types_ptypes_proto protoreflect.FileDescriptor

Functions

func RegisterAggregatorServer

func RegisterAggregatorServer(s grpc.ServiceRegistrar, srv AggregatorServer)

Types

type AggregateRequest

type AggregateRequest struct {
	ObuID int32   `protobuf:"varint,1,opt,name=ObuID,proto3" json:"ObuID,omitempty"`
	Value float64 `protobuf:"fixed64,2,opt,name=Value,proto3" json:"Value,omitempty"`
	Unix  int64   `protobuf:"varint,3,opt,name=Unix,proto3" json:"Unix,omitempty"`
	// contains filtered or unexported fields
}

func (*AggregateRequest) Descriptor deprecated

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

Deprecated: Use AggregateRequest.ProtoReflect.Descriptor instead.

func (*AggregateRequest) GetObuID

func (x *AggregateRequest) GetObuID() int32

func (*AggregateRequest) GetUnix

func (x *AggregateRequest) GetUnix() int64

func (*AggregateRequest) GetValue

func (x *AggregateRequest) GetValue() float64

func (*AggregateRequest) ProtoMessage

func (*AggregateRequest) ProtoMessage()

func (*AggregateRequest) ProtoReflect

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

func (*AggregateRequest) Reset

func (x *AggregateRequest) Reset()

func (*AggregateRequest) String

func (x *AggregateRequest) String() string

type AggregatorClient

type AggregatorClient interface {
	Aggregate(ctx context.Context, in *AggregateRequest, opts ...grpc.CallOption) (*None, error)
	GetInvoice(ctx context.Context, in *GetInvoiceRequest, opts ...grpc.CallOption) (*GetInvoiceResponse, error)
}

AggregatorClient is the client API for Aggregator 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 NewAggregatorClient

func NewAggregatorClient(cc grpc.ClientConnInterface) AggregatorClient

type AggregatorServer

type AggregatorServer interface {
	Aggregate(context.Context, *AggregateRequest) (*None, error)
	GetInvoice(context.Context, *GetInvoiceRequest) (*GetInvoiceResponse, error)
	// contains filtered or unexported methods
}

AggregatorServer is the server API for Aggregator service. All implementations must embed UnimplementedAggregatorServer for forward compatibility

type Distance

type Distance struct {
	Value float64 `json:"value"`
	OBUID int     `json:"obuID"`
	Unix  int64   `json:"unix"`
}

type GetInvoiceRequest

type GetInvoiceRequest struct {
	ObuID int32 `protobuf:"varint,1,opt,name=ObuID,proto3" json:"ObuID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInvoiceRequest) Descriptor deprecated

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

Deprecated: Use GetInvoiceRequest.ProtoReflect.Descriptor instead.

func (*GetInvoiceRequest) GetObuID

func (x *GetInvoiceRequest) GetObuID() int32

func (*GetInvoiceRequest) ProtoMessage

func (*GetInvoiceRequest) ProtoMessage()

func (*GetInvoiceRequest) ProtoReflect

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

func (*GetInvoiceRequest) Reset

func (x *GetInvoiceRequest) Reset()

func (*GetInvoiceRequest) String

func (x *GetInvoiceRequest) String() string

type GetInvoiceResponse

type GetInvoiceResponse struct {
	ObuID         int32   `protobuf:"varint,1,opt,name=ObuID,proto3" json:"ObuID,omitempty"`
	TotalDistance float64 `protobuf:"fixed64,2,opt,name=TotalDistance,proto3" json:"TotalDistance,omitempty"`
	TotalAmount   float64 `protobuf:"fixed64,3,opt,name=TotalAmount,proto3" json:"TotalAmount,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInvoiceResponse) Descriptor deprecated

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

Deprecated: Use GetInvoiceResponse.ProtoReflect.Descriptor instead.

func (*GetInvoiceResponse) GetObuID

func (x *GetInvoiceResponse) GetObuID() int32

func (*GetInvoiceResponse) GetTotalAmount

func (x *GetInvoiceResponse) GetTotalAmount() float64

func (*GetInvoiceResponse) GetTotalDistance

func (x *GetInvoiceResponse) GetTotalDistance() float64

func (*GetInvoiceResponse) ProtoMessage

func (*GetInvoiceResponse) ProtoMessage()

func (*GetInvoiceResponse) ProtoReflect

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

func (*GetInvoiceResponse) Reset

func (x *GetInvoiceResponse) Reset()

func (*GetInvoiceResponse) String

func (x *GetInvoiceResponse) String() string

type Invoice

type Invoice struct {
	OBUID         int     `json:"obuID"`
	TotalDistance float64 `json:"totalDistance"`
	TotalAmount   float64 `json:"totalAmount"`
}

type None

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

func (*None) Descriptor deprecated

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

Deprecated: Use None.ProtoReflect.Descriptor instead.

func (*None) ProtoMessage

func (*None) ProtoMessage()

func (*None) ProtoReflect

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

func (*None) Reset

func (x *None) Reset()

func (*None) String

func (x *None) String() string

type OBUData

type OBUData struct {
	OBUID     int     `json:"obuID"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	RequestID int     `json:"requestID"`
}

type UnimplementedAggregatorServer

type UnimplementedAggregatorServer struct {
}

UnimplementedAggregatorServer must be embedded to have forward compatible implementations.

func (UnimplementedAggregatorServer) Aggregate

func (UnimplementedAggregatorServer) GetInvoice

type UnsafeAggregatorServer

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

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

Jump to

Keyboard shortcuts

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