Documentation ¶
Index ¶
- func OrderStatus(order database.Order) string
- func Run(port, host, certFile, keyFile, email, telegram, bestchangeLink string, ...)
- type ApproveCardConfirmationRequest
- type Balance
- type Balances
- type Busy
- type CancelCardRequest
- type CancelOrderRequest
- type CardConfirmationsResponse
- type ChatMessage
- type ChatMessages
- type ChatUUID
- type CreateBalanceRequest
- type CreateExchangerRequest
- type CreateOrderRequest
- type CreateOrderResponse
- type CreateUserRequest
- type Currencies
- type CurrentRateResponse
- type Endpoints
- func (e *Endpoints) ApproveCard(c echo.Context) error
- func (e *Endpoints) BcExport(c echo.Context) error
- func (e *Endpoints) BcLink(c echo.Context) error
- func (e *Endpoints) CancelCard(c echo.Context) error
- func (e *Endpoints) CancelOrder(c echo.Context) error
- func (e *Endpoints) CardConfirmations(c echo.Context) error
- func (e *Endpoints) ChangeBusy(c echo.Context) error
- func (e *Endpoints) CheckIfAdmin(c echo.Context) error
- func (e *Endpoints) ConfirmPayment(c echo.Context) error
- func (e *Endpoints) CreateBalance(c echo.Context) error
- func (e *Endpoints) CreateCurrency(c echo.Context) error
- func (e *Endpoints) CreateExchanger(c echo.Context) error
- func (e *Endpoints) CreateOrder(c echo.Context) error
- func (e *Endpoints) CreateUser(c echo.Context) error
- func (e *Endpoints) CurrentRate(c echo.Context) error
- func (e *Endpoints) ExecuteOrder(c echo.Context) error
- func (e *Endpoints) FinishedOrders(c echo.Context) error
- func (e *Endpoints) GetCardConfirmations(c echo.Context) error
- func (e *Endpoints) GetChatMessages(c echo.Context) error
- func (e *Endpoints) GetOrders(c echo.Context) error
- func (e *Endpoints) GetUnresolvedChats(c echo.Context) error
- func (e *Endpoints) Info(c echo.Context) error
- func (e *Endpoints) ListBalances(c echo.Context) error
- func (e *Endpoints) ListCurrencies(c echo.Context) error
- func (e *Endpoints) ListExchangers(c echo.Context) error
- func (e *Endpoints) ListOrders(c echo.Context) error
- func (e *Endpoints) Login(c echo.Context) error
- func (e *Endpoints) OrderSearch(c echo.Context) error
- func (e *Endpoints) OrderStatus(c echo.Context) error
- func (e *Endpoints) RemoveBalance(c echo.Context) error
- func (e *Endpoints) RemoveCurrency(c echo.Context) error
- func (e *Endpoints) RemoveExchanger(c echo.Context) error
- func (e *Endpoints) ResolveChat(c echo.Context) error
- func (e *Endpoints) SelfInfo(c echo.Context) error
- func (e *Endpoints) SendChatMessage(c echo.Context) error
- func (e *Endpoints) UpdateBalance(c echo.Context) error
- func (e *Endpoints) ValidateCard(c echo.Context) error
- func (e *Endpoints) VerifyEmail(c echo.Context) error
- type Exchangers
- type ExecuteOrderRequest
- type GetCardConfirmationsResponse
- type InfoResponse
- type Item
- type Order
- type OrderStatusResponse
- type Orders
- type RemoveBalanceRequest
- type RemoveCurrencyRequest
- type RemoveExchangerRequest
- type SelfInfoResponse
- type SendChatMessageRequest
- type UnresolvedChats
- type UpdateBalanceRequest
- type UserOrder
- type UserOrdersResponse
- type ValidateCardRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OrderStatus ¶
Types ¶
type ApproveCardConfirmationRequest ¶
type ApproveCardConfirmationRequest struct {
ConfirmationID int64 `json:"confirmation_id"`
}
type CancelCardRequest ¶
type CancelCardRequest struct {
ConfirmationID int64 `json:"confirmation_id"`
}
type CancelOrderRequest ¶
type CancelOrderRequest struct {
OrderID int64 `json:"order_id"`
}
type CardConfirmationsResponse ¶
type CardConfirmationsResponse struct {
Confirmations []database.CardConfirmation `json:"confirmations"`
}
type ChatMessage ¶
type ChatMessages ¶
type ChatMessages struct {
Messages []ChatMessage `json:"messages"`
}
type CreateBalanceRequest ¶
type CreateExchangerRequest ¶
type CreateOrderRequest ¶
type CreateOrderResponse ¶
type CreateUserRequest ¶
type Currencies ¶
type CurrentRateResponse ¶
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
func (*Endpoints) ApproveCard ¶
ApproveCard godoc
@Summary Mark user credit card as approved @Param status body ApproveCardConfirmationRequest true "Approve card request" @Success 200 @Security ApiKeyAuth @tags operator @Router /operator/approve-card [post]
func (*Endpoints) BcExport ¶
BcExport
@Summary Export to bestchange. @Success 200 {object} rates @tags users @Router /bcexport [get]
func (*Endpoints) BcLink ¶
BcExport
@Summary Export to bestchange. @Success 200 @tags users @Router /bclink [get]
func (*Endpoints) CancelCard ¶
ApproveCard godoc
@Summary Remove user's card request @Param status body CancelCardRequest true "Remove confirmation id" @Success 200 @Security ApiKeyAuth @tags operator @Router /operator/cancel-card [delete]
func (*Endpoints) CancelOrder ¶
CancelOrder godoc
@Summary Cancel user order and mark it as cancelled @Param status body CancelOrderRequest true "Cancel order parameters" @Success 200 @Security ApiKeyAuth @tags operator @Router /admin/cancel-order [post]
func (*Endpoints) CardConfirmations ¶
CardConfirmations godoc
@Summary Get user's card confirmations @Param email query string true "Email" @Success 200 {object} CardConfirmationsResponse @Security ApiKeyAuth @tags operator @Router /operator/card-confirmations [get]
func (*Endpoints) ChangeBusy ¶
ChangeBusy godoc
@Summary Change busy status for admin operator @Param status body Busy true "Busy status" @Success 200 @Security ApiKeyAuth @tags operator @Router /admin/change-busy [post]
func (*Endpoints) CheckIfAdmin ¶
CheckIfAdmin godoc
@Summary Check if user is an admin @Success 200 @Security ApiKeyAuth @tags admin @Router /admin/check-if-admin [post]
func (*Endpoints) ConfirmPayment ¶
ConfirmPayment godoc
@Summary Confirm that payment operation is approved and provide check @Param order_id query string true "Order id" @Param file formData file true "File with operation check" @Success 200 @tags users @Router /confirm-payment [post]
func (*Endpoints) CreateBalance ¶
CreateBalance godoc
@Summary Create new operator balance @Param status body CreateBalanceRequest true "Create balance parameters" @Success 200 @Security ApiKeyAuth @tags operator @Router /admin/create-balance [post]
func (*Endpoints) CreateCurrency ¶
CreateCurrency godoc
@Summary Create new currency in exchanger @Param status body database.CreateCurrencyParams true "Create currency params" @Success 200 @Security ApiKeyAuth @tags admin @Router /admin/create-currency [post]
func (*Endpoints) CreateExchanger ¶
CreateExchanger godoc
@Summary Create new exchanger with provided currencies @Param status body CreateExchangerRequest true "Create exchanger parameters" @Success 200 @Security ApiKeyAuth @tags admin @Router /admin/create-exchanger [post]
func (*Endpoints) CreateOrder ¶
ListExchangers godoc
@Summary Create order to exchange specific currency @Param status body CreateOrderRequest true "Request parameters" @Success 200 {object} CreateOrderResponse @tags users @Router /create-order [post]
func (*Endpoints) CreateUser ¶
CreateUser godoc
@Summary Create new user request @Param status body CreateUserRequest true "Create user request" @Success 200 @tags users @Router /create-user [post]
func (*Endpoints) CurrentRate ¶
CurrentRate godoc
@Summary Current rate at specific currency @Param currency_in path string true "Currency in" @Param currency_out path string true "Currency out" @Param amount path int true "Amount in" @Success 200 {object} CurrentRateResponse @tags users @Router /current-rate [get]
func (*Endpoints) ExecuteOrder ¶
ExecuteOrder godoc
@Summary Execute order and change operator balances, update busy @Param status body ExecuteOrderRequest true "Execute order parameters" @Success 200 @Security ApiKeyAuth @tags operator @Router /admin/execute-order [post]
func (*Endpoints) FinishedOrders ¶
FinishedOrders godoc
@Summary Get finished orders bound to specific operator @Success 200 {object} Orders @Security ApiKeyAuth @tags operator @Router /operator/finished-orders [get]
func (*Endpoints) GetCardConfirmations ¶
GetCardConfirmations godoc
@Summary Get user credit card approval images with parameters @Success 200 {object} GetCardConfirmationsResponse @Security ApiKeyAuth @tags operator @Router /operator/get-card-confirmations [get]
func (*Endpoints) GetChatMessages ¶
GetChatMessages
@Summary Send message that will be read by operators. @Param uuid path string true "UUID sent by email" @Success 200 {object} ChatMessages @tags users @Router /get-chat-messages/{uuid} [get]
func (*Endpoints) GetOrders ¶
GetOrders godoc
@Summary Get active orders bound to specific operator @Success 200 {object} Orders @Security ApiKeyAuth @tags operator @Router /operator/get-orders [get]
func (*Endpoints) GetUnresolvedChats ¶
GetUnresolvedChats godoc
@Summary Get unresolved chat objects @Success 200 {object} UnresolvedChats @Security ApiKeyAuth @tags operator @Router /operator/unresolved-chats [get]
func (*Endpoints) Info ¶
Info godoc
@Summary Get info about the running instance. @Success 200 {object} OrderStatusResponse @tags users @Router /info [get]
func (*Endpoints) ListBalances ¶
ListBalances godoc
@Summary List operator currency balances @Success 200 {object} Balances @Security ApiKeyAuth @tags operator @Router /admin/list-balances [get]
func (*Endpoints) ListCurrencies ¶
ListCurrencies godoc
@Summary Verify user email address @Success 200 {object} Currencies @tags users @Router /list-currencies [get]
func (*Endpoints) ListExchangers ¶
ListExchangers godoc
@Summary List existing exchangers @Success 200 {object} Exchangers @tags users @Router /list-exchangers [get]
func (*Endpoints) ListOrders ¶
ListOrders godoc
@Summary List user's orders @Success 200 {object} UserOrdersResponse @Security ApiKeyAuth @tags users @Router /user/list-orders [get]
func (*Endpoints) Login ¶
Login godoc
@Summary Login and get auth key @Param email header string true "Email" @Param password header string true "Password" @Success 200 {string} string token @tags users @Router /login [post]
func (*Endpoints) OrderSearch ¶
CardConfirmations godoc
@Summary Get user's card confirmations @Param email query string true "Email" @Success 200 {object} Orders @Security ApiKeyAuth @tags operator @Router /operator/order-search [get]
func (*Endpoints) OrderStatus ¶
OrderStatus godoc
@Summary Check order status and return info about order @Param Orderid header string true "orderid" @Success 200 {object} OrderStatusResponse @tags users @Router /order-status [get]
func (*Endpoints) RemoveBalance ¶
RemoveBalance godoc
@Summary Remove operators balance @Param status body RemoveBalanceRequest true "Balance id" @Success 200 @Security ApiKeyAuth @tags operator @Router /admin/remove-balance [delete]
func (*Endpoints) RemoveCurrency ¶
RemoveCurrency godoc
@Summary Remove currency from currency list @Param status body RemoveCurrencyRequest true "Remove currency parameter" @Success 200 @Security ApiKeyAuth @tags admin @Router /admin/remove-currency [delete]
func (*Endpoints) RemoveExchanger ¶
RemoveExchanger godoc
@Summary Remove existing exchanger from API @Param status body RemoveExchangerRequest true "Remove exchanger parameters" @Success 200 @Security ApiKeyAuth @tags admin @Router /admin/remove-exchanger [delete]
func (*Endpoints) ResolveChat ¶
ResolveChat godoc
@Summary Resolve chat @Param status body ChatUUID true "Chat UUID" @Success 200 @Security ApiKeyAuth @tags operator @Router /operator/resolve-chat [post]
func (*Endpoints) SelfInfo ¶
ListOrders godoc
@Summary Get user's self info @Success 200 {object} SelfInfoResponse @Security ApiKeyAuth @tags users @Router /user/self-info [get]
func (*Endpoints) SendChatMessage ¶
SendChatMessage
@Summary Send message that will be read by operators. @Param status body SendChatMessageRequest true "Request parameters" @Success 200 @tags users @Router /send-chat-message [post]
func (*Endpoints) UpdateBalance ¶
UpdateBalance godoc
@Summary Update operator currency balance @Param status body UpdateBalanceRequest true "Update balance parameters" @Success 200 @Security ApiKeyAuth @tags operator @Router /operator/update-balance [post]
func (*Endpoints) ValidateCard ¶
ValidateCard godoc
@Summary Create validate card request @Param email query string true "Email" @Param currency query string true "Currency" @Param addr query string true "Address" @Param file formData file true "Approve file" @Success 200 @tags users @Router /validate-card [post]
func (*Endpoints) VerifyEmail ¶
VerifyEmail godoc
@Summary Verify user email address @Param uuid path string true "UUID sent by email" @Success 200 @tags users @Router /verify/{uuid} [get]
type Exchangers ¶
type ExecuteOrderRequest ¶
type ExecuteOrderRequest struct {
OrderID int64 `json:"order_id"`
}
type GetCardConfirmationsResponse ¶
type GetCardConfirmationsResponse struct {
CardConfirmations []database.CardConfirmation `json:"card_confirmations"`
}
type InfoResponse ¶
type Order ¶
type Order struct { ID int64 `json:"id"` CurrencyIn string `json:"currin"` Email string `json:"email"` AmountIn float64 `json:"amountin"` CurrOut string `json:"currout"` AmountOut float64 `json:"amountout"` Address string `json:"address"` ApprovePicture []byte `json:"approvepic"` Status string `json:"status"` }
type OrderStatusResponse ¶
type OrderStatusResponse struct {
Status string `json:"status"`
}
type RemoveBalanceRequest ¶
type RemoveBalanceRequest struct {
ID int64 `json:"id"`
}
type RemoveCurrencyRequest ¶
type RemoveCurrencyRequest struct {
Code string `json:"code"`
}
type RemoveExchangerRequest ¶
type RemoveExchangerRequest struct {
ID int64 `json:"id"`
}
type SelfInfoResponse ¶
type SendChatMessageRequest ¶
type UnresolvedChats ¶
type UpdateBalanceRequest ¶
type UserOrdersResponse ¶
type UserOrdersResponse struct {
UserOrders []UserOrder `json:"orders"`
}