init
This commit is contained in:
1 parent
eb2c8fea64
commit
17a671a417
21 files changed
+560
-73
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"go_oxspeak_server/models"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
User models.User
|
||||
|
||||
mu sync.RWMutex
|
||||
}
|
||||
|
||||
func newClient(user models.User) *Client {
|
||||
return &Client{
|
||||
User: user,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"github.com/puzpuzpuz/xsync/v4"
|
||||
)
|
||||
|
||||
type ClientManager struct {
|
||||
clients *xsync.Map[string, Client]
|
||||
}
|
||||
|
||||
func NewClientManager() *ClientManager {
|
||||
return &ClientManager{
|
||||
clients: xsync.NewMap[string, Client](),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user