model

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ChannelEmail = "email"
View Source
const ChannelFcm = "push"
View Source
const ChannelMqtt = "mqtt"
View Source
const ChannelWebsocket = "websoket"
View Source
const TopicAnalytics = "analytics"
View Source
const TopicConnector = "connector"
View Source
const TopicDeveloper = "developer"
View Source
const TopicDeviceOffline = "device_offline"
View Source
const TopicIncident = "incident"
View Source
const TopicMGW = "mgw"
View Source
const TopicProcesses = "processes"
View Source
const TopicSmartService = "smart_service"
View Source
const TopicUnknown = "unknown"
View Source
const WsAuthOkType = "authentication confirmed"
View Source
const WsAuthRequestType = "please reauthenticate"
View Source
const WsAuthType = "authentication"
View Source
const WsListType = "notification list"
View Source
const WsRefreshType = "refresh"
View Source
const WsUpdateDeleteManyType = "delete notifications"
View Source
const WsUpdateDeleteType = "delete notification"
View Source
const WsUpdateSetType = "put notification"

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Id        string    `json:"id"`
	Address   string    `json:"address"`
	User      string    `json:"user"`
	Password  string    `json:"password"`
	Topic     string    `json:"topic"`
	Qos       uint8     `json:"qos"`
	Enabled   bool      `json:"enabled"`
	CreatedAt time.Time `json:"created_at" bson:"created_at"`
	UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
	UserId    string    `json:"-" bson:"user_id"`
}

func (*Broker) Equal

func (b *Broker) Equal(other interface{}) bool

type BrokerList

type BrokerList struct {
	Total   int64    `json:"total"`
	Limit   int      `json:"limit"`
	Offset  int      `json:"offset"`
	Brokers []Broker `json:"brokers"`
}

func (*BrokerList) Equal

func (l *BrokerList) Equal(other interface{}) bool

type Channel added in v0.0.4

type Channel = string

func AllChannels added in v0.0.4

func AllChannels() []Channel

type EventMessage

type EventMessage struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload,omitempty"`
}

type FcmToken

type FcmToken struct {
	Token     string    `json:"token"`
	UserId    string    `json:"user_id"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Notification

type Notification struct {
	Id        string    `json:"_id" bson:"_id"`
	UserId    string    `json:"userId" bson:"userId"`
	Title     string    `json:"title" bson:"title"`
	Message   string    `json:"message" bson:"message"`
	IsRead    bool      `json:"isRead" bson:"isRead"`
	CreatedAt time.Time `json:"created_at" bson:"created_at"`
	Topic     `json:"topic" bson:"topic"`
	// contains filtered or unexported fields
}

func (*Notification) Equal

func (n *Notification) Equal(other interface{}) bool

func (*Notification) Hash

func (n *Notification) Hash() [32]byte

func (*Notification) ToDB

func (n *Notification) ToDB() (db NotificationDB, err error)

type NotificationDB

type NotificationDB struct {
	Id        primitive.ObjectID `bson:"_id"`
	UserId    string             `bson:"userId"`
	Title     string             `bson:"title"`
	Message   string             `bson:"message"`
	IsRead    bool               `bson:"isRead"`
	CreatedAt time.Time          `bson:"created_at"`
	Topic     `bson:"topic"`
	Hash      [32]byte `bson:"hash"`
}

type NotificationList

type NotificationList struct {
	Total         int64          `json:"total"`
	Limit         int            `json:"limit"`
	Offset        int            `json:"offset"`
	Notifications []Notification `json:"notifications"`
}

func (*NotificationList) Equal

func (n *NotificationList) Equal(other interface{}) bool

type PlatformBroker

type PlatformBroker struct {
	Enabled bool   `json:"enabled"`
	UserId  string `json:"-" bson:"user_id"`
}

type Settings added in v0.0.4

type Settings struct {
	UserId             string              `json:"-" bson:"user_id"`
	ChannelTopicConfig map[Channel][]Topic `json:"channel_topic_config" bson:"channel_topic_config"`
}

func DefaultSettings added in v0.0.4

func DefaultSettings() Settings

type Topic added in v0.0.4

type Topic = string

func AllTopics added in v0.0.4

func AllTopics() []Topic

Jump to

Keyboard shortcuts

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