code: func (msg *Message) SetType(msgType string) (err error) {
  	if !(msgType == "message" || msgType == "request" || msgType == "direct_request" || msgType == "reply") {
  		return fmt.Errorf("%s is not a valid message type", msgType)
  	}
  
  	if msgType == "direct_request" {
  		if len(msg.DiscoveredHosts) == 0 {
  			return fmt.Errorf("direct_request message type can only be set if DiscoveredHosts have been set")
  		}
  
  		msg.Filter = protocol.NewFilter()
  		msg.Filter.AddAgentFilter(msg.Agent)
  	}
  
  	msg.msgType = msgType
  
  	return
  }
docs: // SetType sets the mssage type. One message, request, direct_request or reply