Documentation ¶
Index ¶
- func Configure(setter config.Setter) error
- func Plugin(n *node.Node, c config.Getter) (engine.Engine, error)
- type Config
- type MgoEngine
- func (e *MgoEngine) AddPresence(ch string, uid string, info proto.ClientInfo, expire int) error
- func (e *MgoEngine) Channels() ([]string, error)
- func (e *MgoEngine) Forbidden(raw.Raw) bool
- func (e *MgoEngine) History(ch, appkey, client string, skip, limit int) ([]proto.Message, int, error)
- func (e *MgoEngine) Name() string
- func (e *MgoEngine) Permission(eid, permission string) bool
- func (e *MgoEngine) Presence(ch string) (map[string]proto.ClientInfo, error)
- func (e *MgoEngine) PublishAdmin(message *proto.AdminMessage) <-chan error
- func (e *MgoEngine) PublishControl(message *proto.ControlMessage) <-chan error
- func (e *MgoEngine) PublishJoin(message *proto.JoinMessage, opts *channel.Options) <-chan error
- func (e *MgoEngine) PublishLeave(message *proto.LeaveMessage, opts *channel.Options) <-chan error
- func (e *MgoEngine) PublishMessage(message *proto.Message, appkey, users, nusers string, opts *channel.Options) <-chan error
- func (e *MgoEngine) ReadMessage(ch, msgid, uid string) (bool, error)
- func (e *MgoEngine) RemovePresence(ch, uid, user string) error
- func (e *MgoEngine) Run() error
- func (e *MgoEngine) Shutdown() error
- func (e *MgoEngine) Subscribe(ch string) error
- func (e *MgoEngine) Unsubscribe(ch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MgoEngine ¶
type MgoEngine struct {
// contains filtered or unexported fields
}
func (*MgoEngine) AddPresence ¶
AddPresence adds client info into presence hub.
func (*MgoEngine) History ¶
func (e *MgoEngine) History(ch, appkey, client string, skip, limit int) ([]proto.Message, int, error)
History extracts history from history hub.
func (*MgoEngine) Permission ¶
func (*MgoEngine) PublishAdmin ¶
func (e *MgoEngine) PublishAdmin(message *proto.AdminMessage) <-chan error
PublishAdmin - see Engine interface description.
func (*MgoEngine) PublishControl ¶
func (e *MgoEngine) PublishControl(message *proto.ControlMessage) <-chan error
PublishControl - see Engine interface description.
func (*MgoEngine) PublishJoin ¶
PublishJoin - see Engine interface description.
func (*MgoEngine) PublishLeave ¶
PublishLeave - see Engine interface description.
func (*MgoEngine) PublishMessage ¶
func (e *MgoEngine) PublishMessage(message *proto.Message, appkey, users, nusers string, opts *channel.Options) <-chan error
PublishMessage adds message into history hub and calls node ClientMsg method to handle message. We don't have any PUB/SUB here as Memory Engine is single node only.
func (*MgoEngine) ReadMessage ¶
func (*MgoEngine) RemovePresence ¶
RemovePresence removes client info from presence hub.
func (*MgoEngine) Run ¶
Run runs memory engine - we do not have any logic here as Memory Engine ready to work just after initialization.
func (*MgoEngine) Unsubscribe ¶
Unsubscribe node from channel. In case of memory engine its only job is to touch channel history for history lifetime period.