code: func NewEvent(v interface{}) *Event {
  	event := &Event{Time: time.Now()}
  	switch v := v.(type) {
  	case *Node:
  		event.Type = EventTypeNode
  		node := *v
  		event.Node = &node
  	case *Conn:
  		event.Type = EventTypeConn
  		conn := *v
  		event.Conn = &conn
  	case *Msg:
  		event.Type = EventTypeMsg
  		msg := *v
  		event.Msg = &msg
  	default:
  		panic(fmt.Sprintf("invalid event type: %T", v))
  	}
  	return event
  }
docs: // NewEvent creates a new event for the given object which should be either a
  // Node, Conn or Msg.
  //
  // The object is copied so that the event represents the state of the object
  // when NewEvent is called.