Documentation
¶
Overview ¶
This file is part of gofmqp.
gofmqp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
gofmqp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with gofmqp. If not, see <https://www.gnu.org/licenses/>.
This file is part of gofmqp.
gofmqp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
gofmqp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with gofmqp. If not, see <https://www.gnu.org/licenses/>.
This file is part of gofmqp.
gofmqp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
gofmqp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with gofmqp. If not, see <https://www.gnu.org/licenses/>.
This file is part of gofmqp.
gofmqp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
gofmqp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with gofmqp. If not, see <https://www.gnu.org/licenses/>.
This file is part of gofmqp.
gofmqp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
gofmqp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with gofmqp. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- func CompareTopics(a, b MsgTopic) bool
- type Cache
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) Next() (msg Message, err error)
- func (c *Connection) NextRaw() (msg RawMessage, err error)
- func (c *Connection) NextUnchecked() (msg Message, err error)
- func (c *Connection) Send(msg *Message) (err error)
- func (c *Connection) SendRaw(msg *RawMessage) (err error)
- type IMsgReader
- type IMsgWriter
- type Id
- type Listener
- type Message
- type MsgReader
- type MsgTopic
- type MsgWriter
- type PackageType
- type RawMessage
- type Router
- func (router *Router) Collect()
- func (router *Router) GetSubscriptions(sub Id) []MsgTopic
- func (router *Router) Route(ptopic MsgTopic) map[Id]bool
- func (router *Router) Sub(sub Id, topic MsgTopic)
- func (router *Router) SubscribersCount(stopic MsgTopic) int
- func (router *Router) Unsub(sub Id, topic MsgTopic)
- func (router *Router) UnsubAll(sub Id)
- type SubscribeType
- type TopicSystem
Constants ¶
const DEFAULT_COLLECTION_FREQUENCY = 100
const NO_COLLECT = 9223372036854775807
Variables ¶
This section is empty.
Functions ¶
func CompareTopics ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Next ¶
func (c *Connection) Next() (msg Message, err error)
func (*Connection) NextRaw ¶
func (c *Connection) NextRaw() (msg RawMessage, err error)
func (*Connection) NextUnchecked ¶
func (c *Connection) NextUnchecked() (msg Message, err error)
func (*Connection) Send ¶
func (c *Connection) Send(msg *Message) (err error)
func (*Connection) SendRaw ¶
func (c *Connection) SendRaw(msg *RawMessage) (err error)
type IMsgReader ¶
type IMsgWriter ¶
type IMsgWriter interface { SendRaw(msg *RawMessage) (err error) Send(msg *Message) (err error) }
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func (*Listener) Accept ¶
func (l *Listener) Accept() (conn Connection, err error)
type Message ¶
type Message struct { Type PackageType SubType SubscribeType TopicType TopicSystem Debug bool LastWill bool Cache bool Topic *MsgTopic Body []byte }
type MsgReader ¶
type MsgReader struct {
// contains filtered or unexported fields
}
func NewMsgReader ¶
func (*MsgReader) NextRaw ¶
func (r *MsgReader) NextRaw() (msg RawMessage, err error)
func (*MsgReader) NextUnchecked ¶
type MsgWriter ¶
type MsgWriter struct {
// contains filtered or unexported fields
}
func NewMsgWriter ¶
func (*MsgWriter) SendRaw ¶
func (w *MsgWriter) SendRaw(msg *RawMessage) (err error)
type PackageType ¶
type PackageType bool
const ( PackageTypePub PackageType = false PackageTypeSub = true )
type RawMessage ¶
type RawMessage struct { Type PackageType SubType SubscribeType TopicType TopicSystem Debug bool LastWill bool Cache bool Topic []byte Body []byte }
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouterFrq ¶
func (*Router) GetSubscriptions ¶
func (*Router) SubscribersCount ¶
type SubscribeType ¶
type SubscribeType bool
const ( SubscribeTypeSub SubscribeType = false SubscribeTypeUnsub = true )
type TopicSystem ¶
type TopicSystem bool
const ( TopicSystemRegular TopicSystem = false TopicSystemFeedback = true )