Documentation
¶
Index ¶
- type DefaultSessionManager
- func (m *DefaultSessionManager) CreateSessionContext(platform, userID, botUserID, channelID, threadID, providerType string) *SessionContext
- func (m *DefaultSessionManager) GenerateEngineSessionID() uuid.UUID
- func (m *DefaultSessionManager) GenerateProviderSessionID(engineSessionID uuid.UUID, providerType string) string
- func (m *DefaultSessionManager) GetChatSessionID(platform, userID, botUserID, channelID, threadID string) string
- type SessionContext
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultSessionManager ¶
type DefaultSessionManager struct {
// contains filtered or unexported fields
}
DefaultSessionManager 默认实现
func NewSessionManager ¶
func NewSessionManager(namespace string) *DefaultSessionManager
func (*DefaultSessionManager) CreateSessionContext ¶
func (m *DefaultSessionManager) CreateSessionContext(platform, userID, botUserID, channelID, threadID, providerType string) *SessionContext
func (*DefaultSessionManager) GenerateEngineSessionID ¶
func (m *DefaultSessionManager) GenerateEngineSessionID() uuid.UUID
func (*DefaultSessionManager) GenerateProviderSessionID ¶
func (m *DefaultSessionManager) GenerateProviderSessionID(engineSessionID uuid.UUID, providerType string) string
func (*DefaultSessionManager) GetChatSessionID ¶
func (m *DefaultSessionManager) GetChatSessionID(platform, userID, botUserID, channelID, threadID string) string
type SessionContext ¶
type SessionContext struct {
ChatSessionID string
ChatPlatform string
ChatUserID string
ChatBotUserID string
ChatChannelID string
ChatThreadID string
EngineSessionID uuid.UUID
EngineNamespace string
ProviderSessionID string
ProviderType string
}
SessionContext 完整会话上下文
type SessionManager ¶
type SessionManager interface {
GetChatSessionID(platform, userID, botUserID, channelID, threadID string) string
GenerateEngineSessionID() uuid.UUID
GenerateProviderSessionID(engineSessionID uuid.UUID, providerType string) string
CreateSessionContext(platform, userID, botUserID, channelID, threadID, providerType string) *SessionContext
}
SessionManager 统一管理三层 SessionID (DRY 原则)
Click to show internal directories.
Click to hide internal directories.