MCPcopy Create free account
hub / github.com/astercloud/aster / InitializeSession

Method InitializeSession

pkg/workflow/workflow.go:185–200  ·  view source on GitHub ↗

===== 会话管理 ===== InitializeSession 初始化会话

(sessionID, userID string)

Source from the content-addressed store, hash-verified

183
184// InitializeSession 初始化会话
185func (w *Workflow) InitializeSession(sessionID, userID string) (string, string) {
186 if sessionID == "" {
187 if w.SessionID != "" {
188 sessionID = w.SessionID
189 } else {
190 sessionID = uuid.New().String()
191 w.SessionID = sessionID
192 }
193 }
194
195 if userID == "" {
196 userID = w.UserID
197 }
198
199 return sessionID, userID
200}
201
202// GetSession 获取会话
203func (w *Workflow) GetSession(sessionID string) (*WorkflowSession, error) {

Callers 1

ExecuteMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected