Documentation ¶
Index ¶
- type ExchangeServiceServer
- func (s *ExchangeServiceServer) ListExchanges(in *pb.Empty, stream pb.ExchangesService_ListExchangesServer) error
- func (s *ExchangeServiceServer) LoadFeatures(filePath string)
- func (s *ExchangeServiceServer) ReadExchange(ctx context.Context, in *pb.ReadReq) (*pb.ReadRes, error)
- func (s *ExchangeServiceServer) Upvote(ctx context.Context, in *pb.VoteRequest) (*pb.VoteResponse, error)
- type ExchangeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeServiceServer ¶
type ExchangeServiceServer struct { *pb.UnimplementedExchangesServiceServer // contains filtered or unexported fields }
ExchangeServiceServer is a implementation of ExchangeService provided by gRPC
func NewExchangeServiceServer ¶
func NewExchangeServiceServer() *ExchangeServiceServer
NewExchangeServiceServer returns a pointer to a ExchangeServiceServer
func (*ExchangeServiceServer) ListExchanges ¶
func (s *ExchangeServiceServer) ListExchanges(in *pb.Empty, stream pb.ExchangesService_ListExchangesServer) error
ListExchange takes an Empty request, returning a stream of Exchange
func (*ExchangeServiceServer) LoadFeatures ¶
func (s *ExchangeServiceServer) LoadFeatures(filePath string)
loadFeatures loads features from a JSON file.
func (*ExchangeServiceServer) ReadExchange ¶
func (*ExchangeServiceServer) Upvote ¶
func (s *ExchangeServiceServer) Upvote(ctx context.Context, in *pb.VoteRequest) (*pb.VoteResponse, error)
Upvote takes a VoteRequest and updates the "upvotes" field on a given exchange returning a VoteResponse if successful.
type ExchangeType ¶
type ExchangeType struct { Id primitive.ObjectID `bson:"_id,omitempty"` ExchangeId string `bson:"exchange_id"` Name string `bson:"name"` Website string `bson:"website"` Upvotes int32 `bson:"upvotes"` Downvotes int32 `bson:"downvotes"` }
ExchangeType represents the bson readable data from the protobuf
Click to show internal directories.
Click to hide internal directories.