code: func (r *DrvRegistry) RegisterDriver(ntype string, driver driverapi.Driver, capability driverapi.Capability) error {
  	if strings.TrimSpace(ntype) == "" {
  		return errors.New("network type string cannot be empty")
  	}
  
  	r.Lock()
  	dd, ok := r.drivers[ntype]
  	r.Unlock()
  
  	if ok && dd.driver.IsBuiltIn() {
  		return driverapi.ErrActiveRegistration(ntype)
  	}
  
  	if r.dfn != nil {
  		if err := r.dfn(ntype, driver, capability); err != nil {
  			return err
  		}
  	}
  
  	dData := &driverData{driver, capability}
  
  	r.Lock()
  	r.drivers[ntype] = dData
  	r.Unlock()
  
  	return nil
  }
docs: // RegisterDriver registers the network driver when it gets discovered.