FindByID returns the event with the given monotonic ID, if it's still in the ring. Used by /debug show to look up a specific event.
(id uint64)
| 183 | // FindByID returns the event with the given monotonic ID, if it's still in |
| 184 | // the ring. Used by /debug show to look up a specific event. |
| 185 | func FindByID(id uint64) (Event, bool) { |
| 186 | mu.Lock() |
| 187 | defer mu.Unlock() |
| 188 | for _, e := range events { |
| 189 | if e.ID == id { |
| 190 | return e, true |
| 191 | } |
| 192 | } |
| 193 | return Event{}, false |
| 194 | } |
| 195 | |
| 196 | // Latest returns the most recent event that has a non-empty payload, or |
| 197 | // (zero, false) if the ring is empty or no event has a payload yet. |
no outgoing calls