model

package
v0.0.0-...-6fdabb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const WAIT_FOR_PUB_ACK = 10

qos 1

View Source
const WAIT_FOR_PUB_COMP = 21
View Source
const WAIT_FOR_PUB_REC = 20

qos 2

View Source
const WAIT_FOR_PUB_REL = 20

Variables

This section is empty.

Functions

func SessionExpired

func SessionExpired(lastSeen int64, expiryInterval int64) bool

Types

type Client

type Client struct {
	ID           int64
	ClientId     string
	Username     string
	Password     []byte
	SubscribeAcl string
	PublishAcl   string
	CreatedAt    int64
}

type Message

type Message struct {
	Topic       string
	Qos         byte
	Retained    bool
	Payload     string
	PayloadType byte
}

type Retain

type Retain struct {
	ClientID           string
	Topic              string
	ApplicationMessage []byte
	CreatedAt          int64
}

type Retry

type Retry struct {
	ID                 int64
	ClientId           string
	ApplicationMessage []byte
	PacketIdentifier   int
	Qos                uint8
	Dup                bool
	Retries            uint8
	AckStatus          uint8
	CreatedAt          int64
	SessionID          int64
	ReasonCode         uint8
}

func (Retry) Expired

func (r Retry) Expired() bool

type RunningSession

type RunningSession struct {
	ID              int64
	SessionID       int64
	ClientId        string
	ProtocolVersion uint8
	LastSeen        int64
	LastConnect     int64
	Connected       bool
	ExpiryInterval  int64
	ConnectFlags    uint8
	KeepAlive       int
	WillTopic       string
	WillDelay       int64
	WillMessage     []byte
	Username        string
	Password        string
	SubscribeAcl    string
	PublishAcl      string
	Conn            TagyouConn
	Mu              sync.RWMutex
}

func (*RunningSession) ApplyAcl

func (s *RunningSession) ApplyAcl(pubAcl string, subAcl string)

func (*RunningSession) ApplySessionId

func (s *RunningSession) ApplySessionId(sessionID int64)

func (*RunningSession) CleanStart

func (s *RunningSession) CleanStart() bool

func (*RunningSession) Expired

func (s *RunningSession) Expired() bool

func (*RunningSession) FromLocalhost

func (s *RunningSession) FromLocalhost() bool

func (*RunningSession) GetClientId

func (s *RunningSession) GetClientId() string

func (*RunningSession) GetConn

func (s *RunningSession) GetConn() TagyouConn

func (*RunningSession) GetConnected

func (s *RunningSession) GetConnected() bool

func (*RunningSession) GetExpiryInterval

func (s *RunningSession) GetExpiryInterval() int64

func (*RunningSession) GetId

func (s *RunningSession) GetId() int64

func (*RunningSession) GetKeepAlive

func (s *RunningSession) GetKeepAlive() int

func (*RunningSession) GetLastConnect

func (s *RunningSession) GetLastConnect() int64

func (*RunningSession) GetLastSeen

func (s *RunningSession) GetLastSeen() int64

func (*RunningSession) GetProtocolVersion

func (s *RunningSession) GetProtocolVersion() uint8

func (*RunningSession) HavePass

func (s *RunningSession) HavePass() bool

func (*RunningSession) HaveUser

func (s *RunningSession) HaveUser() bool

func (*RunningSession) ReservedBit

func (s *RunningSession) ReservedBit() bool

func (*RunningSession) SetConnected

func (s *RunningSession) SetConnected(connected bool)

func (*RunningSession) WillFlag

func (s *RunningSession) WillFlag() bool

func (*RunningSession) WillQoS

func (s *RunningSession) WillQoS() uint8

func (*RunningSession) WillRetain

func (s *RunningSession) WillRetain() bool

type Session

type Session struct {
	ID              int64
	LastSeen        int64
	LastConnect     int64
	ExpiryInterval  int64
	ClientId        string
	Connected       bool
	ProtocolVersion uint8
}

func (Session) Expired

func (s Session) Expired() bool

func (Session) GetClientId

func (s Session) GetClientId() string

func (Session) GetConnected

func (s Session) GetConnected() bool

func (Session) GetExpiryInterval

func (s Session) GetExpiryInterval() int64

func (Session) GetId

func (s Session) GetId() int64

func (Session) GetLastConnect

func (s Session) GetLastConnect() int64

func (Session) GetLastSeen

func (s Session) GetLastSeen() int64

func (Session) GetProtocolVersion

func (s Session) GetProtocolVersion() uint8

type Subscription

type Subscription struct {
	ClientId          string
	Topic             string
	RetainHandling    uint8
	RetainAsPublished uint8
	NoLocal           uint8
	Qos               uint8
	ProtocolVersion   uint8
	Enabled           bool
	CreatedAt         int64
	SessionID         int64
	Shared            bool
	ShareName         string
}

type SubscriptionGroup

type SubscriptionGroup map[string][]Subscription

type TagyouConn

type TagyouConn interface {
	Write(b []byte) (n int, err error)
	Close() error
	RemoteAddr() net.Addr
}

type User

type User struct {
	ID        int64
	Username  string
	Password  []byte
	CreatedAt int64
}

* Users enabled to connect to http apis

type WebsocketConnection

type WebsocketConnection struct {
	Conn *websocket.Conn
}

func (WebsocketConnection) Close

func (c WebsocketConnection) Close() error

func (WebsocketConnection) RemoteAddr

func (c WebsocketConnection) RemoteAddr() net.Addr

func (WebsocketConnection) Write

func (c WebsocketConnection) Write(b []byte) (n int, e error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL