mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-10-24 16:10:31 +08:00
27 lines
395 B
Go
27 lines
395 B
Go
package chatmessagesstorage
|
|
|
|
import (
|
|
"github.com/xaionaro-go/streamctl/pkg/streamd/api"
|
|
"github.com/xaionaro-go/xsync"
|
|
)
|
|
|
|
const (
|
|
MaxMessages = 1000
|
|
)
|
|
|
|
type ChatMessagesStorage struct {
|
|
xsync.Mutex
|
|
FilePath string
|
|
IsSorted bool
|
|
IsChanged bool
|
|
Messages []api.ChatMessage
|
|
}
|
|
|
|
func New(
|
|
filePath string,
|
|
) *ChatMessagesStorage {
|
|
return &ChatMessagesStorage{
|
|
FilePath: filePath,
|
|
}
|
|
}
|