major change of server slim it down
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
package models
|
||||
|
||||
type Response struct {
|
||||
StatusCode int `json:"statusCode"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Data string `json:"dat,omitempty"`
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
package models
|
||||
|
||||
import "github.com/coder/websocket"
|
||||
|
||||
type Subscribers map[*websocket.Conn]*bool
|
||||
|
||||
func InitSubsrcibers() Subscribers {
|
||||
return make(Subscribers)
|
||||
}
|
||||
|
||||
func (s *Subscribers) Connect(conn *websocket.Conn) {
|
||||
b := true
|
||||
(*s)[conn] = &b
|
||||
}
|
||||
|
||||
func (s *Subscribers) DeleteSubsrcibers(conn *websocket.Conn) {
|
||||
delete(*s, conn)
|
||||
}
|
||||
|
||||
func (s *Subscribers) GetPointer(conn *websocket.Conn) *bool {
|
||||
return (*s)[conn]
|
||||
}
|
||||
|
||||
func (s *Subscribers) Disconnect(conn *websocket.Conn) {
|
||||
*(*s)[conn] = false
|
||||
}
|
Reference in New Issue
Block a user