code: func (c *containerAdapter) events(ctx context.Context) <-chan events.Message {
  	log.G(ctx).Debugf("waiting on events")
  	buffer, l := c.backend.SubscribeToEvents(time.Time{}, time.Time{}, c.container.eventFilter())
  	eventsq := make(chan events.Message, len(buffer))
  
  	for _, event := range buffer {
  		eventsq <- event
  	}
  
  	go func() {
  		defer c.backend.UnsubscribeFromEvents(l)
  
  		for {
  			select {
  			case ev := <-l:
  				jev, ok := ev.(events.Message)
  				if !ok {
  					log.G(ctx).Warnf("unexpected event message: %q", ev)
  					continue
  				}
  				select {
  				case eventsq <- jev:
  				case <-ctx.Done():
  					return
  				}
  			case <-ctx.Done():
  				return
  			}
  		}
  	}()
  
  	return eventsq
  }
docs: // events issues a call to the events API and returns a channel with all
  // events. The stream of events can be shutdown by cancelling the context.