code: func (e *Events) loadBufferedEvents(since, until time.Time, topic func(interface{}) bool) []eventtypes.Message {
  	var buffered []eventtypes.Message
  	if since.IsZero() && until.IsZero() {
  		return buffered
  	}
  
  	var sinceNanoUnix int64
  	if !since.IsZero() {
  		sinceNanoUnix = since.UnixNano()
  	}
  
  	var untilNanoUnix int64
  	if !until.IsZero() {
  		untilNanoUnix = until.UnixNano()
  	}
  
  	for i := len(e.events) - 1; i >= 0; i-- {
  		ev := e.events[i]
  
  		if ev.TimeNano < sinceNanoUnix {
  			break
  		}
  
  		if untilNanoUnix > 0 && ev.TimeNano > untilNanoUnix {
  			continue
  		}
  
  		if topic == nil || topic(ev) {
  			buffered = append([]eventtypes.Message{ev}, buffered...)
  		}
  	}
  	return buffered
  }
docs: // loadBufferedEvents iterates over the cached events in the buffer
  // and returns those that were emitted between two specific dates.
  // It uses `time.Unix(seconds, nanoseconds)` to generate valid dates with those arguments.
  // It filters those buffered messages with a topic function if it's not nil, otherwise it adds all messages.