Created
January 12, 2022 18:19
-
-
Save StephanieSunshine/33c61dac69fb40785a29d1e4e1b77c34 to your computer and use it in GitHub Desktop.
gRPC auction prototype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
option go_package = "github.com/StephanieSunshine/go-auction"; | |
package auction; | |
service Auction { | |
rpc ListAll() returns (Auctions) {} | |
rpc GetAuction(AuctionId) returns (AuctionData) {} | |
rpc StreamUpdates(AuctionId) returns (stream AuctionUpdates) {} | |
rpc PlaceBid(NewBid) returns (BidCert) {} | |
rpc CreateAuction(NewAuction) returns (AuctionCert) {} | |
} | |
message BidData { | |
uint32 user_id = 1; | |
uint32 auction_id = 2; | |
uint32 amount = 3; | |
} | |
message AuctionData { | |
uint32 auction_id = 1; | |
string title = 2; | |
string description = 3; | |
uint32 starting_price = 4; | |
uint32 current_bid_price = 5; | |
uint32 current_bid_userid = 6; | |
string last_bid_when = 7; | |
string time_start = 8; | |
string time_end = 9; | |
uint32 owner_user_id = 10; | |
} | |
message Auctions { | |
repeated AuctionData auctions = 1; | |
} | |
message AuctionId { | |
uint32 auction_id = 1; | |
} | |
message AuctionUpdates { | |
BidData bid = 1; | |
} | |
message NewBid { | |
string auth_token = 1; | |
BidData bid = 2; | |
} | |
message BidCert { | |
uint32 auction_id = 1; | |
string bid_id = 2; | |
string timestamp = 3; | |
} | |
message NewAuction { | |
string auth_token = 1; | |
AuctionData new = 2; | |
} | |
message AuctionCert { | |
uint32 auction_id = 1; | |
string timestamp = 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment