Documentation
¶
Index ¶
Constants ¶
View Source
const ( WebSocket = "WS" ServerSentEvents = "SSE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { ID string `json:"id"` Config *ChannelConfig `json:"config"` Type string `json:"type"` // contains filtered or unexported fields }
func NewChannel ¶
func NewChannel(dto *dtos.CreateChannelDTO, consumer ConsumerAdapter, producer ProducerAdapter) (*Channel, error)
func (*Channel) BroadcastMessage ¶
func (*Channel) DeleteClient ¶
func (*Channel) IsMaxOfConnections ¶
type ChannelConfig ¶
type ChannelConfig struct {
MaxOfChannelConnections int `json:"maxOfChannelConnections"`
}
type Client ¶
type Client struct { ID string `json:"id"` ChannelID string `json:"channelId"` UserAgent string `json:"userAgent"` IPAddress string `json:"ipAddress"` // contains filtered or unexported fields }
func NewClient ¶
func NewClient(dto *dtos.CreateClientDTO) *Client
func (*Client) MessageChan ¶
type ConsumerAdapter ¶
type Message ¶
type Message struct { ID string `json:"id"` ChannelID string `json:"channelId"` ClientID string `json:"clientId"` Payload string `json:"payload"` CreatedAt time.Time `json:"createdAt"` }
func MessageFromJSON ¶
func (*Message) MessageToJSON ¶
type ProducerAdapter ¶
Click to show internal directories.
Click to hide internal directories.