dero-swaps/clients/variables.go

32 lines
527 B
Go
Raw Permalink Normal View History

2024-04-20 22:21:02 +02:00
package clients
import (
"sync"
"github.com/lesismal/nbio/nbhttp/websocket"
)
const (
LOCK = iota
UNLOCK
)
type (
ClientInfo struct {
PairInfo []PairInfo `json:"pair_info"`
Nickname string `json:"nickname"`
}
PairInfo struct {
Pair string `json:"pair"`
Balance float64 `json:"balance"`
}
)
type SwapState struct {
Client map[*websocket.Conn]bool
Result map[*websocket.Conn]*websocket.Conn
sync.RWMutex
}
var Clients sync.Map
2024-04-20 22:23:48 +02:00
var ActiveClients = SwapState{Client: make(map[*websocket.Conn]bool)}