Documentation ¶
Index ¶
- Variables
- func RegisterAuctionhouseServiceServer(s grpc.ServiceRegistrar, srv AuctionhouseServiceServer)
- type AuctionhouseServiceClient
- type AuctionhouseServiceServer
- type AuctionhouseService_BidClient
- type AuctionhouseService_BidServer
- type AuctionhouseService_ResultClient
- type AuctionhouseService_ResultServer
- type BidRequest
- type QueryResult
- type ResponseToQuery
- func (*ResponseToQuery) Descriptor() ([]byte, []int)deprecated
- func (x *ResponseToQuery) GetAuctionStatusMessage() string
- func (x *ResponseToQuery) GetHighestBid() int32
- func (x *ResponseToQuery) GetHighestBidderID() int32
- func (x *ResponseToQuery) GetItem() string
- func (*ResponseToQuery) ProtoMessage()
- func (x *ResponseToQuery) ProtoReflect() protoreflect.Message
- func (x *ResponseToQuery) Reset()
- func (x *ResponseToQuery) String() string
- type Status
- type StatusOfBid
- func (*StatusOfBid) Descriptor() ([]byte, []int)deprecated
- func (x *StatusOfBid) GetHighestBid() int32
- func (x *StatusOfBid) GetStatus() Status
- func (*StatusOfBid) ProtoMessage()
- func (x *StatusOfBid) ProtoReflect() protoreflect.Message
- func (x *StatusOfBid) Reset()
- func (x *StatusOfBid) String() string
- type UnimplementedAuctionhouseServiceServer
- type UnsafeAuctionhouseServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "NOW_HIGHEST_BIDDER", 1: "TOO_LOW_BID", 2: "EXCEPTION", } Status_value = map[string]int32{ "NOW_HIGHEST_BIDDER": 0, "TOO_LOW_BID": 1, "EXCEPTION": 2, } )
Enum value maps for Status.
var AuctionhouseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.AuctionhouseService", HandlerType: (*AuctionhouseServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Result", Handler: _AuctionhouseService_Result_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Bid", Handler: _AuctionhouseService_Bid_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "auctionhouse.proto", }
AuctionhouseService_ServiceDesc is the grpc.ServiceDesc for AuctionhouseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_auctionhouse_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuctionhouseServiceServer ¶
func RegisterAuctionhouseServiceServer(s grpc.ServiceRegistrar, srv AuctionhouseServiceServer)
Types ¶
type AuctionhouseServiceClient ¶
type AuctionhouseServiceClient interface { // result: send stream of qmgs bc client can ask at any point of time // what the highest bid in the round is. //prints winner when time runs out to all clients. Result(ctx context.Context, opts ...grpc.CallOption) (AuctionhouseService_ResultClient, error) // First call to Bid registers the auctioners // Bidders can bid several times, but a bid must be higher than the previous one(s) Bid(ctx context.Context, opts ...grpc.CallOption) (AuctionhouseService_BidClient, error) }
AuctionhouseServiceClient is the client API for AuctionhouseService 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 NewAuctionhouseServiceClient ¶
func NewAuctionhouseServiceClient(cc grpc.ClientConnInterface) AuctionhouseServiceClient
type AuctionhouseServiceServer ¶
type AuctionhouseServiceServer interface { // result: send stream of qmgs bc client can ask at any point of time // what the highest bid in the round is. //prints winner when time runs out to all clients. Result(AuctionhouseService_ResultServer) error // First call to Bid registers the auctioners // Bidders can bid several times, but a bid must be higher than the previous one(s) Bid(AuctionhouseService_BidServer) error // contains filtered or unexported methods }
AuctionhouseServiceServer is the server API for AuctionhouseService service. All implementations must embed UnimplementedAuctionhouseServiceServer for forward compatibility
type AuctionhouseService_BidClient ¶
type AuctionhouseService_BidClient interface { Send(*BidRequest) error Recv() (*StatusOfBid, error) grpc.ClientStream }
type AuctionhouseService_BidServer ¶
type AuctionhouseService_BidServer interface { Send(*StatusOfBid) error Recv() (*BidRequest, error) grpc.ServerStream }
type AuctionhouseService_ResultClient ¶
type AuctionhouseService_ResultClient interface { Send(*QueryResult) error Recv() (*ResponseToQuery, error) grpc.ClientStream }
type AuctionhouseService_ResultServer ¶
type AuctionhouseService_ResultServer interface { Send(*ResponseToQuery) error Recv() (*QueryResult, error) grpc.ServerStream }
type BidRequest ¶
type BidRequest struct { ClientId int32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"` Amount int32 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
Send a new bid + subscribing
func (*BidRequest) Descriptor
deprecated
func (*BidRequest) Descriptor() ([]byte, []int)
Deprecated: Use BidRequest.ProtoReflect.Descriptor instead.
func (*BidRequest) GetAmount ¶
func (x *BidRequest) GetAmount() int32
func (*BidRequest) GetClientId ¶
func (x *BidRequest) GetClientId() int32
func (*BidRequest) ProtoMessage ¶
func (*BidRequest) ProtoMessage()
func (*BidRequest) ProtoReflect ¶
func (x *BidRequest) ProtoReflect() protoreflect.Message
func (*BidRequest) Reset ¶
func (x *BidRequest) Reset()
func (*BidRequest) String ¶
func (x *BidRequest) String() string
type QueryResult ¶
type QueryResult struct { ClientId int32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"` // contains filtered or unexported fields }
Message for prompting asking for highest bidder
func (*QueryResult) Descriptor
deprecated
func (*QueryResult) Descriptor() ([]byte, []int)
Deprecated: Use QueryResult.ProtoReflect.Descriptor instead.
func (*QueryResult) GetClientId ¶
func (x *QueryResult) GetClientId() int32
func (*QueryResult) ProtoMessage ¶
func (*QueryResult) ProtoMessage()
func (*QueryResult) ProtoReflect ¶
func (x *QueryResult) ProtoReflect() protoreflect.Message
func (*QueryResult) Reset ¶
func (x *QueryResult) Reset()
func (*QueryResult) String ¶
func (x *QueryResult) String() string
type ResponseToQuery ¶
type ResponseToQuery struct { AuctionStatusMessage string `protobuf:"bytes,1,opt,name=auctionStatusMessage,proto3" json:"auctionStatusMessage,omitempty"` HighestBid int32 `protobuf:"varint,2,opt,name=highestBid,proto3" json:"highestBid,omitempty"` HighestBidderID int32 `protobuf:"varint,3,opt,name=highestBidderID,proto3" json:"highestBidderID,omitempty"` Item string `protobuf:"bytes,4,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
Highest bidder info - highest bid, and bidder
func (*ResponseToQuery) Descriptor
deprecated
func (*ResponseToQuery) Descriptor() ([]byte, []int)
Deprecated: Use ResponseToQuery.ProtoReflect.Descriptor instead.
func (*ResponseToQuery) GetAuctionStatusMessage ¶
func (x *ResponseToQuery) GetAuctionStatusMessage() string
func (*ResponseToQuery) GetHighestBid ¶
func (x *ResponseToQuery) GetHighestBid() int32
func (*ResponseToQuery) GetHighestBidderID ¶
func (x *ResponseToQuery) GetHighestBidderID() int32
func (*ResponseToQuery) GetItem ¶
func (x *ResponseToQuery) GetItem() string
func (*ResponseToQuery) ProtoMessage ¶
func (*ResponseToQuery) ProtoMessage()
func (*ResponseToQuery) ProtoReflect ¶
func (x *ResponseToQuery) ProtoReflect() protoreflect.Message
func (*ResponseToQuery) Reset ¶
func (x *ResponseToQuery) Reset()
func (*ResponseToQuery) String ¶
func (x *ResponseToQuery) String() string
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StatusOfBid ¶
type StatusOfBid struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=proto.Status" json:"status,omitempty"` HighestBid int32 `protobuf:"varint,2,opt,name=highestBid,proto3" json:"highestBid,omitempty"` // contains filtered or unexported fields }
Was bid successful?
func (*StatusOfBid) Descriptor
deprecated
func (*StatusOfBid) Descriptor() ([]byte, []int)
Deprecated: Use StatusOfBid.ProtoReflect.Descriptor instead.
func (*StatusOfBid) GetHighestBid ¶
func (x *StatusOfBid) GetHighestBid() int32
func (*StatusOfBid) GetStatus ¶
func (x *StatusOfBid) GetStatus() Status
func (*StatusOfBid) ProtoMessage ¶
func (*StatusOfBid) ProtoMessage()
func (*StatusOfBid) ProtoReflect ¶
func (x *StatusOfBid) ProtoReflect() protoreflect.Message
func (*StatusOfBid) Reset ¶
func (x *StatusOfBid) Reset()
func (*StatusOfBid) String ¶
func (x *StatusOfBid) String() string
type UnimplementedAuctionhouseServiceServer ¶
type UnimplementedAuctionhouseServiceServer struct { }
UnimplementedAuctionhouseServiceServer must be embedded to have forward compatible implementations.
type UnsafeAuctionhouseServiceServer ¶
type UnsafeAuctionhouseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuctionhouseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuctionhouseServiceServer will result in compilation errors.