handler

package
v0.0.0-...-ec14ce0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDGenerator = func() string {
	return uuid.New()
}

IDGenerator generates command IDs. Function is used to ease mocking.

Functions

func CheckPermissions

func CheckPermissions(ctx context.Context, req *pb.Order) error

CheckPermissions checks that the request is authorized and the sender has the proper permissions.

Types

type MarketService

type MarketService interface {
	CreateAskOrder(o pb.Order) error
	CreateBidOrder(o pb.Order) error
	TouchOrders(IDs []string) error
	CancelOrder(ID string) error

	OrderByID(ID string, result interface{}) error
	MatchOrders(req *pb.Order, limit uint64, result interface{}) error
}

type Marketplace

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

Marketplace a GRPC Server implementing Marketplace API.

func NewMarketplace

func NewMarketplace(marketService MarketService) *Marketplace

NewMarketplace creates a new instance of Marketplace.

func (*Marketplace) CancelOrder

func (m *Marketplace) CancelOrder(ctx context.Context, req *pb.Order) (*pb.Empty, error)

CancelOrder removes the given order from the storage.

func (*Marketplace) CreateOrder

func (m *Marketplace) CreateOrder(ctx context.Context, req *pb.Order) (*pb.Order, error)

CreateOrder creates an order.

func (*Marketplace) GetOrderByID

func (m *Marketplace) GetOrderByID(ctx context.Context, req *pb.ID) (*pb.Order, error)

GetOrderByID retrieves order information by order id.

func (*Marketplace) GetOrders

func (m *Marketplace) GetOrders(ctx context.Context, req *pb.GetOrdersRequest) (*pb.GetOrdersReply, error)

GetOrders retrieves orders by matching the given order options against the storage.

func (*Marketplace) GetProcessing

func (m *Marketplace) GetProcessing(ctx context.Context, req *pb.Empty) (*pb.GetProcessingReply, error)

GetProcessing method exists just to match the Marketplace interface. The Market service itself is unable to know anything about processing orders. This method is implemented for Node in `insonmnia/node/market.go:348`

func (*Marketplace) TouchOrders

func (m *Marketplace) TouchOrders(ctx context.Context, req *pb.TouchOrdersRequest) (*pb.Empty, error)

CancelOrder removes the given order from the storage.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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