exchanges

package
v0.0.0-...-51098ac Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

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 (s *ExchangeServiceServer) ReadExchange(ctx context.Context, in *pb.ReadReq) (*pb.ReadRes, error)

func (*ExchangeServiceServer) Upvote

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

Jump to

Keyboard shortcuts

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