Get 获取会话
(ctx context.Context, req *GetRequest)
| 53 | |
| 54 | // Get 获取会话 |
| 55 | func (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 更新会话 |
| 72 | func (s *InMemoryService) Update(ctx context.Context, req *UpdateRequest) error { |
no outgoing calls