Documentation ¶
Index ¶
- type MessagingClient
- func (c *MessagingClient) Close() error
- func (c *MessagingClient) Conn(topicID uint64) influxdb.MessagingConn
- func (c *MessagingClient) DefaultConnFunc(topicID uint64) influxdb.MessagingConn
- func (c *MessagingClient) DefaultPublishFunc(m *messaging.Message) (uint64, error)
- func (c *MessagingClient) Open(path string) error
- func (c *MessagingClient) Publish(m *messaging.Message) (uint64, error)
- func (c *MessagingClient) SetURLs([]url.URL)
- func (c *MessagingClient) Sync(index uint64)
- func (c *MessagingClient) URLs() []url.URL
- type MessagingConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessagingClient ¶
type MessagingClient struct { PublishFunc func(*messaging.Message) (uint64, error) ConnFunc func(topicID uint64) influxdb.MessagingConn // contains filtered or unexported fields }
MessagingClient represents a test client for the messaging broker.
func NewMessagingClient ¶
func NewMessagingClient() *MessagingClient
NewMessagingClient returns a new instance of MessagingClient.
func (*MessagingClient) Close ¶
func (c *MessagingClient) Close() error
Close closes all open connections.
func (*MessagingClient) Conn ¶
func (c *MessagingClient) Conn(topicID uint64) influxdb.MessagingConn
func (*MessagingClient) DefaultConnFunc ¶
func (c *MessagingClient) DefaultConnFunc(topicID uint64) influxdb.MessagingConn
DefaultConnFunc returns a connection for a specific topic.
func (*MessagingClient) DefaultPublishFunc ¶
func (c *MessagingClient) DefaultPublishFunc(m *messaging.Message) (uint64, error)
DefaultPublishFunc sets an autoincrementing index on the message and sends it to each topic connection.
func (*MessagingClient) Open ¶
func (c *MessagingClient) Open(path string) error
func (*MessagingClient) Publish ¶
func (c *MessagingClient) Publish(m *messaging.Message) (uint64, error)
func (*MessagingClient) SetURLs ¶
func (c *MessagingClient) SetURLs([]url.URL)
func (*MessagingClient) Sync ¶
func (c *MessagingClient) Sync(index uint64)
Sync blocks until a given index has been sent through the client.
func (*MessagingClient) URLs ¶
func (c *MessagingClient) URLs() []url.URL
type MessagingConn ¶
type MessagingConn struct {
// contains filtered or unexported fields
}
MessagingConn represents a mockable connection implementing influxdb.MessagingConn.
func NewMessagingConn ¶
func NewMessagingConn(topicID uint64) *MessagingConn
NewMessagingConn returns a new instance of MessagingConn.
func (*MessagingConn) C ¶
func (c *MessagingConn) C() <-chan *messaging.Message
C returns a channel for streaming message.
func (*MessagingConn) Close ¶
func (c *MessagingConn) Close() error
Close closes the streaming channel.
func (*MessagingConn) Open ¶
func (c *MessagingConn) Open(index uint64, streaming bool) error
Open starts the stream from a given index.
func (*MessagingConn) Send ¶
func (c *MessagingConn) Send(m *messaging.Message)