Documentation ¶
Index ¶
- Constants
- Variables
- type ConnectionLog
- type ConnectionLogImpl
- func (this *ConnectionLogImpl) Connect(client string)
- func (this *ConnectionLogImpl) Disconnect(client string)
- func (this *ConnectionLogImpl) SetCleanSession(client string, clean bool)
- func (this *ConnectionLogImpl) Subscribe(client string, topic string, deviceId string)
- func (this *ConnectionLogImpl) Unsubscribe(client string, topic string, deviceId string)
- type VoidType
- func (this *VoidType) Connect(client string)
- func (this *VoidType) Disconnect(client string)
- func (this *VoidType) SetCleanSession(id string, session bool)
- func (this *VoidType) Subscribe(client string, topic string, deviceId string)
- func (this *VoidType) Unsubscribe(client string, topic string, deviceId string)
Constants ¶
View Source
const SqlAnyDeviceSubscription = `SELECT DISTINCT Device FROM ClientDeviceSubscription WHERE Device = any($1) AND Inactive = FALSE LIMIT $2`
View Source
const SqlCheckDeviceSubscriptionExists = `SELECT COUNT(1) FROM ClientDeviceSubscription WHERE Device = $1 AND Inactive = FALSE LIMIT 1;`
View Source
const SqlCleanSessionUpsert = `INSERT INTO CleanSession(Client, CleanSession) VALUES ($1, $2) ON CONFLICT (Client) DO UPDATE SET CleanSession = $2;`
View Source
const SqlCreateCleanSessionTable = `CREATE TABLE IF NOT EXISTS CleanSession (
Client VARCHAR(255) NOT NULL,
CleanSession BOOLEAN,
PRIMARY KEY (Client)
);`
View Source
const SqlCreateSubscriptionTable = `` /* 373-byte string literal not displayed */
View Source
const SqlDeleteClient = `DELETE FROM ClientDeviceSubscription WHERE Client = $1;`
View Source
const SqlDeleteSubscription = `DELETE FROM ClientDeviceSubscription WHERE Client = $1 AND Topic = $2;`
View Source
const SqlQueryCleanSession = `SELECT CleanSession FROM CleanSession WHERE Client = $1 LIMIT 1;`
View Source
const SqlSelectDeviceByClient = `SELECT DISTINCT Device FROM ClientDeviceSubscription WHERE Client = $1;`
View Source
const SqlSetClientInactive = `UPDATE ClientDeviceSubscription SET Inactive = $2 WHERE Client = $1;`
View Source
const SqlStoreSubscription = `INSERT INTO ClientDeviceSubscription(Client, Topic, Device) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING;`
Variables ¶
View Source
var Timeout = 1 * time.Second
View Source
var Void = &VoidType{}
Functions ¶
This section is empty.
Types ¶
type ConnectionLog ¶
type ConnectionLog interface { Connect(client string) Disconnect(client string) Subscribe(client string, topic string, deviceId string) Unsubscribe(client string, topic string, deviceId string) SetCleanSession(id string, session bool) }
func New ¶
func New(producer kafka.ProducerInterface, conStr string, deviceLogTopic string) (result ConnectionLog, err error)
type ConnectionLogImpl ¶
type ConnectionLogImpl struct {
// contains filtered or unexported fields
}
func (*ConnectionLogImpl) Connect ¶
func (this *ConnectionLogImpl) Connect(client string)
func (*ConnectionLogImpl) Disconnect ¶
func (this *ConnectionLogImpl) Disconnect(client string)
func (*ConnectionLogImpl) SetCleanSession ¶
func (this *ConnectionLogImpl) SetCleanSession(client string, clean bool)
func (*ConnectionLogImpl) Subscribe ¶
func (this *ConnectionLogImpl) Subscribe(client string, topic string, deviceId string)
func (*ConnectionLogImpl) Unsubscribe ¶
func (this *ConnectionLogImpl) Unsubscribe(client string, topic string, deviceId string)
type VoidType ¶
type VoidType struct{}
func (*VoidType) Disconnect ¶
func (*VoidType) SetCleanSession ¶
Click to show internal directories.
Click to hide internal directories.