code: func NewClient(o *ClientOptions) Client {
  	c := &client{}
  	c.options = *o
  
  	if c.options.Store == nil {
  		c.options.Store = NewMemoryStore()
  	}
  	switch c.options.ProtocolVersion {
  	case 3, 4:
  		c.options.protocolVersionExplicit = true
  	case 0x83, 0x84:
  		c.options.protocolVersionExplicit = true
  	default:
  		c.options.ProtocolVersion = 4
  		c.options.protocolVersionExplicit = false
  	}
  	c.persist = c.options.Store
  	c.status = disconnected
  	c.messageIds = messageIds{index: make(map[uint16]tokenCompletor)}
  	c.msgRouter, c.stopRouter = newRouter()
  	c.msgRouter.setDefaultHandler(c.options.DefaultPublishHandler)
  	if !c.options.AutoReconnect {
  		c.options.MessageChannelDepth = 0
  	}
  	return c
  }
docs: // NewClient will create an MQTT v3.1.1 client with all of the options specified
  // in the provided ClientOptions. The client must have the Connect method called
  // on it before it may be used. This is to make sure resources (such as a net
  // connection) are created before the application is actually ready.