GetEvent 获取事件
(eventID string)
| 616 | |
| 617 | // GetEvent 获取事件 |
| 618 | func (al *InMemoryAuditLog) GetEvent(eventID string) (*AuditEvent, error) { |
| 619 | al.mu.RLock() |
| 620 | defer al.mu.RUnlock() |
| 621 | |
| 622 | for i := range al.events { |
| 623 | if al.events[i].ID == eventID { |
| 624 | return &al.events[i], nil |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | return nil, fmt.Errorf("event %s not found", eventID) |
| 629 | } |
| 630 | |
| 631 | // GetEventsByUser 根据用户获取事件 |
| 632 | func (al *InMemoryAuditLog) GetEventsByUser(userID string, limit int) ([]*AuditEvent, error) { |
no outgoing calls