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

Method Get

pkg/session/inmemory.go:55–69  ·  view source on GitHub ↗

Get 获取会话

(ctx context.Context, req *GetRequest)

Source from the content-addressed store, hash-verified

53
54// Get 获取会话
55func (s *InMemoryService) Get(ctx context.Context, req *GetRequest) (Session, error) {
56 s.mu.RLock()
57 defer s.mu.RUnlock()
58
59 session, ok := s.sessions[req.SessionID]
60 if !ok {
61 return nil, ErrSessionNotFound
62 }
63
64 if session.appName != req.AppName || session.userID != req.UserID {
65 return nil, ErrSessionNotFound
66 }
67
68 return session, nil
69}
70
71// Update 更新会话
72func (s *InMemoryService) Update(ctx context.Context, req *UpdateRequest) error {

Callers 4

TestInMemoryService_GetFunction · 0.95

Calls

no outgoing calls

Tested by 4

TestInMemoryService_GetFunction · 0.76