search

package
v0.0.0-...-b400eb5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockHashDecorator

func BlockHashDecorator(blockHash blockhash.BlockHash, fn func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func FeeRecipientHandler

func FeeRecipientHandler(affiliateService affiliates.AffiliateService) func(http.ResponseWriter, *http.Request)

func FormatResponse

func FormatResponse(orders []dbModule.Order, format string, total, page, perPage int) ([]byte, string, error)

func FormatSingleResponse

func FormatSingleResponse(order *dbModule.Order, format string) ([]byte, string, error)

func HealthCheckHandler

func HealthCheckHandler(db *gorm.DB, blockHash blockhash.BlockHash) func(http.ResponseWriter, *http.Request)

func OrderBookHandler

func OrderBookHandler(db *gorm.DB) func(http.ResponseWriter, *http.Request, types.Pool)

func OrderHandler

func OrderHandler(db *gorm.DB) func(http.ResponseWriter, *http.Request)

func PairHandler

func PairHandler(db *gorm.DB) func(http.ResponseWriter, *http.Request)

func SearchHandler

func SearchHandler(db *gorm.DB) func(http.ResponseWriter, *http.Request, types.Pool)

Types

type ApiError

type ApiError struct {
	Code   int64             `json:"code"`
	Reason string            `json:"reason"`
	Errors []ValidationError `json:validationErrors`
}

type FormattedOrder

type FormattedOrder struct {
	Order    *types.Order   `json:"order"`
	Metadata *OrderMetadata `json:"metaData"`
}

func GetFormattedOrder

func GetFormattedOrder(order dbModule.Order) *FormattedOrder

type HealthCheck

type HealthCheck struct {
	BlockHash string
}

type OrderBook

type OrderBook struct {
	Asks *PagedResult `json:"asks"`
	Bids *PagedResult `json:"bids"`
}

type OrderMetadata

type OrderMetadata struct {
	Hash                      string                  `json:"hash"`
	FeeRate                   float64                 `json:"feeRate"`
	Status                    int64                   `json:"status"`
	TakerAssetAmountRemaining string                  `json:"takerAssetAmountRemaining"`
	TakerAssetMetadata        *dbModule.AssetMetadata `json:"takerAssetMetadata,omitempty"`
	MakerAssetMetadata        *dbModule.AssetMetadata `json:"makerAssetMetadata,omitempty"`
}

type PagedOrders

type PagedOrders struct {
	Total   int              `json:"total"`
	Page    int              `json:"page"`
	PerPage int              `json:"perPage"`
	Records []FormattedOrder `json:"records"`
}

type PagedResult

type PagedResult struct {
	Total   int         `json:"total"`
	Page    int         `json:"page"`
	PerPage int         `json:"perPage"`
	Records interface{} `json:"records"`
}

func GetPagedResult

func GetPagedResult(total, page, per_page int, records interface{}) *PagedResult

type ValidationError

type ValidationError struct {
	Err   string `json:"reason"`
	Code  int64  `json:"code"`
	Field string `json:"field"`
}

func QueryFilter

func QueryFilter(query *gorm.DB, queryObject urlModule.Values) (*gorm.DB, []ValidationError)

Jump to

Keyboard shortcuts

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