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

Method GetEvent

pkg/security/audit.go:618–629  ·  view source on GitHub ↗

GetEvent 获取事件

(eventID string)

Source from the content-addressed store, hash-verified

616
617// GetEvent 获取事件
618func (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 根据用户获取事件
632func (al *InMemoryAuditLog) GetEventsByUser(userID string, limit int) ([]*AuditEvent, error) {

Calls

no outgoing calls