transport

package module
v0.0.0-...-9b9461c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: CC0-1.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeGetAPIStatusEndpoint

func MakeGetAPIStatusEndpoint() endpoint.Endpoint

MakeGetAPIStatusEndpoint returns an endpoint via the passed service. Primarily useful in a server.

func MakeGetTradeEndpoint

func MakeGetTradeEndpoint(s trader.Service) endpoint.Endpoint

MakeGetTradeEndpoint returns an endpoint via the passed service. Primarily useful in a server.

func MakeGetTradesEndpoint

func MakeGetTradesEndpoint(s trader.Service) endpoint.Endpoint

MakeGetTradesEndpoint returns an endpoint via the passed service. Primarily useful in a server.

func MakePostTradeEndpoint

func MakePostTradeEndpoint(s trader.Service) endpoint.Endpoint

MakePostTradeEndpoint returns an endpoint via the passed service. Primarily useful in a server.

Types

type Endpoints

type Endpoints struct {
	PostTradeEndpoint    endpoint.Endpoint
	GetTradesEndpoint    endpoint.Endpoint
	GetTradeEndpoint     endpoint.Endpoint
	GetAPIStatusEndpoint endpoint.Endpoint
}

Endpoints collects all of the endpoints part of Trader

func MakeServerEndpoints

func MakeServerEndpoints(s trader.Service) Endpoints

MakeServerEndpoints returns an Endpoints struct where each endpoint invokes the corresponding method on the provided trader.Service. Useful in a trader.Service server.

type GetAPIStatusRequest

type GetAPIStatusRequest struct{}

GetAPIStatusRequest request object

type GetAPIStatusResponse

type GetAPIStatusResponse struct {
	Status string `json:"status,omitempty"`
	Err    error  `json:"err,omitempty"`
}

GetAPIStatusResponse response object

type GetTradeRequest

type GetTradeRequest struct {
	ID uuid.UUID
}

GetTradeRequest request object

type GetTradeResponse

type GetTradeResponse struct {
	Trade trader.Trade `json:"trade,omitempty"`
	Err   error        `json:"err,omitempty"`
}

GetTradeResponse response object

type GetTradesRequest

type GetTradesRequest struct{}

GetTradesRequest struct

type GetTradesResponse

type GetTradesResponse struct {
	Trades []trader.Trade `json:"trades,omitempty"`
	Err    error          `json:"err,omitempty"`
}

GetTradesResponse response object

type PostTradeRequest

type PostTradeRequest struct {
	Trade trader.Trade `json:"trade,omitempty"`
}

PostTradeRequest request object

type PostTradeResponse

type PostTradeResponse struct {
	ID  string `json:"id,omitempty"`
	Err error  `json:"err,omitempty"`
}

PostTradeResponse response object

Directories

Path Synopsis
http module

Jump to

Keyboard shortcuts

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