Documentation ¶
Index ¶
- Constants
- Variables
- type CommandMsg
- type Configuration
- type MemoryStore
- func (this *MemoryStore) Client(UID string) (map[string]*Socket, error)
- func (this *MemoryStore) Clients() map[string]map[string]*Socket
- func (this *MemoryStore) Count() (int64, error)
- func (this *MemoryStore) Remove(sock *Socket) error
- func (this *MemoryStore) Save(sock *Socket) error
- func (this *MemoryStore) SetPage(sock *Socket) error
- func (this *MemoryStore) UnsetPage(sock *Socket) error
- type Message
- type RedisStore
- func (this *RedisStore) Clients() ([]string, error)
- func (this *RedisStore) CloseConn(conn *redis.Client)
- func (this *RedisStore) Count() (int64, error)
- func (this *RedisStore) GetConn() (*redis.Client, error)
- func (this *RedisStore) Publish(channel string, message string)
- func (this *RedisStore) Remove(sock *Socket) error
- func (this *RedisStore) Save(sock *Socket) error
- func (this *RedisStore) SetPage(sock *Socket) error
- func (this *RedisStore) Subscribe(c chan []string, channel string) (*redis.Client, error)
- func (this *RedisStore) UnsetPage(sock *Socket) error
- type Server
- type Socket
- type Storage
- func (this *Storage) Client(UID string) (map[string]*Socket, error)
- func (this *Storage) ClientList() ([]string, error)
- func (this *Storage) Clients() map[string]map[string]*Socket
- func (this *Storage) Count() (int64, error)
- func (this *Storage) Remove(sock *Socket) error
- func (this *Storage) Save(sock *Socket) error
- func (this *Storage) SetPage(sock *Socket) error
- func (this *Storage) UnsetPage(sock *Socket) error
Constants ¶
View Source
const ClientsKey = "SocketClients"
View Source
const PageKey = "PageClients"
Variables ¶
View Source
var CLIENT_BROAD bool
View Source
var DEBUG bool
Functions ¶
This section is empty.
Types ¶
type CommandMsg ¶
type CommandMsg struct { Command map[string]string `json:"command"` Message map[string]interface{} `json:"message,omitempty"` }
func (*CommandMsg) FromApp ¶
func (this *CommandMsg) FromApp(server *Server)
func (*CommandMsg) FromRedis ¶
func (this *CommandMsg) FromRedis(server *Server)
func (*CommandMsg) FromSocket ¶
func (this *CommandMsg) FromSocket(sock *Socket)
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func InitConfig ¶
func InitConfig(mymap map[string]string) Configuration
func (*Configuration) Get ¶
func (this *Configuration) Get(name string) string
func (*Configuration) GetBool ¶
func (this *Configuration) GetBool(name string) bool
func (*Configuration) GetInt ¶
func (this *Configuration) GetInt(name string) int
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func (*MemoryStore) Client ¶
func (this *MemoryStore) Client(UID string) (map[string]*Socket, error)
func (*MemoryStore) Count ¶
func (this *MemoryStore) Count() (int64, error)
func (*MemoryStore) Remove ¶
func (this *MemoryStore) Remove(sock *Socket) error
func (*MemoryStore) Save ¶
func (this *MemoryStore) Save(sock *Socket) error
func (*MemoryStore) SetPage ¶
func (this *MemoryStore) SetPage(sock *Socket) error
func (*MemoryStore) UnsetPage ¶
func (this *MemoryStore) UnsetPage(sock *Socket) error
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func (*RedisStore) Clients ¶
func (this *RedisStore) Clients() ([]string, error)
func (*RedisStore) CloseConn ¶
func (this *RedisStore) CloseConn(conn *redis.Client)
func (*RedisStore) Count ¶
func (this *RedisStore) Count() (int64, error)
func (*RedisStore) Publish ¶
func (this *RedisStore) Publish(channel string, message string)
func (*RedisStore) Remove ¶
func (this *RedisStore) Remove(sock *Socket) error
func (*RedisStore) Save ¶
func (this *RedisStore) Save(sock *Socket) error
func (*RedisStore) SetPage ¶
func (this *RedisStore) SetPage(sock *Socket) error
func (*RedisStore) UnsetPage ¶
func (this *RedisStore) UnsetPage(sock *Socket) error
type Server ¶
type Server struct { ID string Config *Configuration Store *Storage Debug bool // contains filtered or unexported fields }
func CreateServer ¶
func CreateServer(conf *Configuration, store *Storage) *Server
func (*Server) AppListener ¶
func (this *Server) AppListener(msg interface{})
func (*Server) LongPollListener ¶
func (this *Server) LongPollListener(w http.ResponseWriter, r *http.Request)
func (*Server) RedisListener ¶
func (this *Server) RedisListener()
func (*Server) SendHeartbeats ¶
func (this *Server) SendHeartbeats()
func (*Server) SocketListener ¶
func (this *Server) SocketListener(w http.ResponseWriter, r *http.Request)
type Socket ¶
type Socket struct { SID string // socket ID, randomly generated UID string // User ID, passed in via client Page string // Current page, if set. Server *Server Debug bool // contains filtered or unexported fields }
func (*Socket) Authenticate ¶
type Storage ¶
type Storage struct { StorageType string // contains filtered or unexported fields }
func InitStore ¶
func InitStore(Config *Configuration) *Storage
func (*Storage) ClientList ¶
Click to show internal directories.
Click to hide internal directories.