Documentation
¶
Index ¶
- Constants
- Variables
- func NewExtension(opts ...ConfigOption) forge.Extension
- func NewExtensionWithConfig(config Config) forge.Extension
- func NewLocalRoom(opts RoomOptions) *local.LocalRoom
- type ActivityInfo
- type AnalyticsEvent
- type AnalyticsQuery
- type AnalyticsResult
- type Availability
- type BackendError
- type Channel
- type ChannelStore
- type Config
- type ConfigOption
- func WithAuthentication(username, password string) ConfigOption
- func WithBackend(backend string) ConfigOption
- func WithBackendURLs(urls ...string) ConfigOption
- func WithBufferSizes(read, write int) ConfigOption
- func WithConfig(config Config) ConfigOption
- func WithConnectionLimits(perUser, roomsPerUser, channelsPerUser int) ConfigOption
- func WithFeatures(rooms, channels, presence, typing, history bool) ConfigOption
- func WithLocalBackend() ConfigOption
- func WithMessageLimits(maxSize, maxPerSecond int) ConfigOption
- func WithMessageRetention(retention time.Duration) ConfigOption
- func WithNATSBackend(urls ...string) ConfigOption
- func WithNodeID(nodeID string) ConfigOption
- func WithPresenceTimeout(timeout time.Duration) ConfigOption
- func WithRedisBackend(url string) ConfigOption
- func WithRequireConfig(require bool) ConfigOption
- func WithTLS(certFile, keyFile, caFile string) ConfigOption
- func WithTimeouts(ping, pong, write time.Duration) ConfigOption
- func WithTypingTimeout(timeout time.Duration) ConfigOption
- type Connection
- type ConnectionInfo
- type DeviceInfo
- type DistributedBackend
- type DistributedBackendOptions
- type Extension
- func (e *Extension) AsyncAPISpec() *forge.AsyncAPISpec
- func (e *Extension) Health(ctx context.Context) error
- func (e *Extension) Manager() Manager
- func (e *Extension) Register(app forge.App) error
- func (e *Extension) RegisterRoutes(router forge.Router, wsPath, ssePath string) error
- func (e *Extension) Start(ctx context.Context) error
- func (e *Extension) Stop(ctx context.Context) error
- type FileInfo
- type FileQuery
- type FileUpload
- type HistoryQuery
- type Invite
- type InviteOptions
- type LocalRoom
- type Lock
- type Manager
- type ManagerStats
- type Member
- type MemberOptions
- type Message
- type MessageEdit
- type MessageHandler
- type MessageReaction
- type MessageSearchQuery
- type MessageStore
- type ModerationEvent
- type ModerationStatus
- type NodeChangeEvent
- type NodeChangeHandler
- type NodeInfo
- type OnlineStats
- type PresenceEvent
- type PresenceFilters
- type PresenceOptions
- type PresenceStore
- type PresenceTracker
- type RateLimitStatus
- type Room
- type RoomBan
- type RoomEvent
- type RoomOptions
- type RoomStats
- type RoomStore
- type TypingOptions
- type TypingStore
- type TypingTracker
- type UserPresence
- type UserPresenceStats
- type UserStats
- type WebhookConfig
Constants ¶
const MessageTypeJoin = internal.MessageTypeJoin
const MessageTypeLeave = internal.MessageTypeLeave
const MessageTypeMessage = internal.MessageTypeMessage
Message type constants
const MessageTypePresence = internal.MessageTypePresence
const MessageTypeTyping = internal.MessageTypeTyping
const StatusAway = internal.StatusAway
const StatusBusy = internal.StatusBusy
const StatusOffline = internal.StatusOffline
const StatusOnline = internal.StatusOnline
Status constants
Variables ¶
var DefaultPresenceOptions = internal.DefaultPresenceOptions
Default option functions
var DefaultTypingOptions = internal.DefaultTypingOptions
var ErrAlreadyRoomMember = internal.ErrAlreadyRoomMember
var ErrAlreadySubscribed = internal.ErrAlreadySubscribed
var ErrBackendNotFound = internal.ErrBackendNotConnected
var ErrBackendTimeout = internal.ErrBackendTimeout
var ErrChannelAlreadyExists = internal.ErrChannelAlreadyExists
var ErrChannelNotFound = internal.ErrChannelNotFound
Channel errors
var ErrConnectionClosed = internal.ErrConnectionClosed
var ErrConnectionLimitReached = internal.ErrConnectionLimitReached
var ErrConnectionNotFound = internal.ErrConnectionNotFound
Connection errors
var ErrInsufficientRole = internal.ErrInsufficientRole
var ErrInvalidChannel = internal.ErrInvalidChannel
var ErrInvalidConfig = internal.ErrInvalidConfig
var ErrInvalidConnection = internal.ErrInvalidConnection
var ErrInvalidMessage = internal.ErrInvalidMessage
var ErrInvalidPermission = internal.ErrInvalidPermission
var ErrInvalidRoom = internal.ErrInvalidRoom
var ErrInvalidStatus = internal.ErrInvalidStatus
var ErrInviteExpired = internal.ErrInviteExpired
var ErrInviteNotFound = internal.ErrInviteNotFound
Invite errors
var ErrLockAcquisitionFailed = internal.ErrLockAcquisitionFailed
var ErrLockNotHeld = internal.ErrLockNotHeld
var ErrMessageNotFound = internal.ErrMessageNotFound
var ErrMessageTooLarge = internal.ErrMessageTooLarge
var ErrNodeNotFound = internal.ErrNodeNotFound
var ErrNotRoomMember = internal.ErrNotRoomMember
var ErrNotSubscribed = internal.ErrNotSubscribed
var ErrPermissionDenied = internal.ErrPermissionDenied
Permission errors
var ErrPresenceNotFound = internal.ErrPresenceNotFound
var ErrRoomAlreadyExists = internal.ErrRoomAlreadyExists
var ErrRoomFull = internal.ErrRoomFull
var ErrRoomLimitReached = internal.ErrRoomLimitReached
var ErrRoomNotFound = internal.ErrRoomNotFound
Room errors
var NewBackendError = internal.NewBackendError
var NewChannelError = internal.NewChannelError
var NewConnectionError = internal.NewConnectionError
Error constructors
var NewMessageError = internal.NewMessageError
var NewRoomError = internal.NewRoomError
Functions ¶
func NewExtension ¶
func NewExtension(opts ...ConfigOption) forge.Extension
NewExtension creates a new streaming extension with functional options.
func NewExtensionWithConfig ¶
NewExtensionWithConfig creates a new streaming extension with a complete config.
Types ¶
type ActivityInfo ¶
type ActivityInfo = internal.ActivityInfo
type AnalyticsEvent ¶
type AnalyticsEvent = internal.AnalyticsEvent
type AnalyticsQuery ¶
type AnalyticsQuery = internal.AnalyticsQuery
type Availability ¶
type Availability = internal.Availability
type ChannelStore ¶
type ChannelStore = internal.ChannelStore
type ConfigOption ¶
type ConfigOption = internal.ConfigOption
func WithAuthentication ¶
func WithAuthentication(username, password string) ConfigOption
func WithBackend ¶
func WithBackend(backend string) ConfigOption
func WithBackendURLs ¶
func WithBackendURLs(urls ...string) ConfigOption
func WithBufferSizes ¶
func WithBufferSizes(read, write int) ConfigOption
func WithConfig ¶
func WithConfig(config Config) ConfigOption
func WithConnectionLimits ¶
func WithConnectionLimits(perUser, roomsPerUser, channelsPerUser int) ConfigOption
func WithFeatures ¶
func WithFeatures(rooms, channels, presence, typing, history bool) ConfigOption
func WithLocalBackend ¶
func WithLocalBackend() ConfigOption
func WithMessageLimits ¶
func WithMessageLimits(maxSize, maxPerSecond int) ConfigOption
func WithMessageRetention ¶
func WithMessageRetention(retention time.Duration) ConfigOption
func WithNATSBackend ¶
func WithNATSBackend(urls ...string) ConfigOption
func WithNodeID ¶
func WithNodeID(nodeID string) ConfigOption
func WithPresenceTimeout ¶
func WithPresenceTimeout(timeout time.Duration) ConfigOption
func WithRedisBackend ¶
func WithRedisBackend(url string) ConfigOption
func WithRequireConfig ¶
func WithRequireConfig(require bool) ConfigOption
func WithTLS ¶
func WithTLS(certFile, keyFile, caFile string) ConfigOption
func WithTimeouts ¶
func WithTimeouts(ping, pong, write time.Duration) ConfigOption
func WithTypingTimeout ¶
func WithTypingTimeout(timeout time.Duration) ConfigOption
type Connection ¶
type Connection = internal.EnhancedConnection
func NewConnection ¶
func NewConnection(conn forge.Connection) Connection
NewConnection creates a new enhanced connection.
type DeviceInfo ¶
type DeviceInfo = internal.DeviceInfo
type DistributedBackendOptions ¶
type DistributedBackendOptions = internal.DistributedBackendOptions
type Extension ¶
type Extension struct {
*forge.BaseExtension
// contains filtered or unexported fields
}
Extension implements forge.Extension for streaming functionality.
func (*Extension) AsyncAPISpec ¶
func (e *Extension) AsyncAPISpec() *forge.AsyncAPISpec
AsyncAPISpec generates AsyncAPI 3.0.0 specification for the streaming extension This documents all streaming channels, operations, and message types
func (*Extension) RegisterRoutes ¶
RegisterRoutes is a helper to register WebSocket and SSE routes with the router.
type InviteOptions ¶
type InviteOptions = internal.InviteOptions
type Manager ¶
Core interfaces
func NewManager ¶
func NewManager( config Config, roomStore RoomStore, channelStore ChannelStore, messageStore MessageStore, presenceTracker PresenceTracker, typingTracker TypingTracker, distributed DistributedBackend, logger forge.Logger, metrics forge.Metrics, ) Manager
NewManager creates a new streaming manager.
type ManagerStats ¶
type ManagerStats = internal.ManagerStats
type MemberOptions ¶
type MemberOptions = internal.MemberOptions
type MessageEdit ¶
type MessageEdit = internal.MessageEdit
type MessageHandler ¶
type MessageHandler = internal.MessageHandler
type MessageReaction ¶
type MessageReaction = internal.MessageReaction
type MessageSearchQuery ¶
type MessageSearchQuery = internal.MessageSearchQuery
type MessageStore ¶
type MessageStore = internal.MessageStore
type ModerationEvent ¶
type ModerationEvent = internal.ModerationEvent
type NodeChangeEvent ¶
type NodeChangeEvent = internal.NodeChangeEvent
type NodeChangeHandler ¶
type NodeChangeHandler = internal.NodeChangeHandler
type OnlineStats ¶
type OnlineStats = internal.OnlineStats
type PresenceFilters ¶
type PresenceFilters = internal.PresenceFilters
type PresenceOptions ¶
type PresenceOptions = internal.PresenceOptions
type PresenceStore ¶
type PresenceStore = internal.PresenceStore
type RoomOptions ¶
type RoomOptions = internal.RoomOptions
type TypingStore ¶
type TypingStore = internal.TypingStore
type TypingTracker ¶
type TypingTracker = internal.TypingTracker
type UserPresence ¶
type UserPresence = internal.UserPresence
type UserPresenceStats ¶
type UserPresenceStats = internal.UserPresenceStats