Documentation ¶
Index ¶
- func Configure(setter config.Setter) error
- func Plugin(n *node.Node, c config.Getter) (engine.Engine, error)
- type Config
- type DBData
- type DataBakup
- type Engine
- func (e *Engine) AddPresence(ch string, uid string, info proto.ClientInfo, expire int) error
- func (e *Engine) Channels() ([]string, error)
- func (e *Engine) Forbidden(raw.Raw) bool
- func (e *Engine) History(ch, appkey, client, last string, skip, limit int) ([]proto.Message, int, error)
- func (e *Engine) Micro(connID string, cmd proto.MicroCommand) (proto.Response, error)
- func (e *Engine) Name() string
- func (e *Engine) Permission(eid, permission string) bool
- func (e *Engine) Presence(ch string) (map[string]proto.ClientInfo, error)
- func (e *Engine) PublishAdmin(message *proto.AdminMessage) <-chan error
- func (e *Engine) PublishControl(message *proto.ControlMessage) <-chan error
- func (e *Engine) PublishJoin(message *proto.JoinMessage, opts *channel.Options) <-chan error
- func (e *Engine) PublishLeave(message *proto.LeaveMessage, opts *channel.Options) <-chan error
- func (e *Engine) PublishMessage(message *proto.Message, appkey, users, nusers string, opts *channel.Options) <-chan error
- func (e *Engine) ReadMessage(ch, msgid, uid string) (bool, error)
- func (e *Engine) RemovePresence(ch, uid, user string) error
- func (e *Engine) Run() error
- func (e *Engine) Save()
- func (e *Engine) Shutdown() error
- func (e *Engine) Subscribe(ch string) error
- func (e *Engine) Unsubscribe(ch string) error
- type Persence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBData ¶
type DBData struct { ID uint `gorm:"primary_key"` UID string `json:"uid"` Channel string `json:"channel"` Client string `json:"client"` Data raw.Raw `json:"data" gorm:"type:jsonb"` Info *proto.ClientInfo `json:"info" gorm:"type:jsonb"` Read bool `json:"read"` Timestamp int64 `json:"timestamp"` Appkey pq.StringArray `json:"-" gorm:"type:varchar(125)[]"` Users pq.StringArray `json:"-" gorm:"type:varchar(125)[]"` NUsers pq.StringArray `json:"-" gorm:"type:varchar(125)[]"` }
type DataBakup ¶
type DataBakup struct {
// contains filtered or unexported fields
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) AddPresence ¶
AddPresence adds client info into presence hub.
func (*Engine) History ¶
func (e *Engine) History(ch, appkey, client, last string, skip, limit int) ([]proto.Message, int, error)
History extracts history from history hub.
func (*Engine) Permission ¶
func (*Engine) PublishAdmin ¶
func (e *Engine) PublishAdmin(message *proto.AdminMessage) <-chan error
PublishAdmin - see Engine interface description.
func (*Engine) PublishControl ¶
func (e *Engine) PublishControl(message *proto.ControlMessage) <-chan error
PublishControl - see Engine interface description.
func (*Engine) PublishJoin ¶
PublishJoin - see Engine interface description.
func (*Engine) PublishLeave ¶
PublishLeave - see Engine interface description.
func (*Engine) PublishMessage ¶
func (e *Engine) 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 (*Engine) RemovePresence ¶
RemovePresence removes client info from presence hub.
func (*Engine) Run ¶
Run runs memory engine - we do not have any logic here as Memory Engine ready to work just after initialization.
func (*Engine) Unsubscribe ¶
Unsubscribe node from channel. In case of memory engine its only job is to touch channel history for history lifetime period.