code: func PublishMessage(config *Config, msg *packet.Message, timeout time.Duration) error {
  	// create client
  	client := New()
  
  	// connect to broker
  	future, err := client.Connect(config)
  	if err != nil {
  		return err
  	}
  
  	// wait on future
  	err = future.Wait(timeout)
  	if err != nil {
  		return err
  	}
  
  	// publish message
  	publishFuture, err := client.PublishMessage(msg)
  	if err != nil {
  		return err
  	}
  
  	// wait on future
  	err = publishFuture.Wait(timeout)
  	if err != nil {
  		return err
  	}
  
  	// disconnect
  	err = client.Disconnect()
  	if err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // PublishMessage will connect to the specified broker to publish the passed message.