func (c *MemStore) AddController(name string, one ControllerDetails) error {
	c.mu.Lock()
	defer c.mu.Unlock()

	if err := ValidateControllerName(name); err != nil {
		return err
	}
	if err := ValidateControllerDetails(one); err != nil {
		return err
	}

	if _, ok := c.Controllers[name]; ok {
		return errors.AlreadyExistsf("controller with name %s", name)
	}

	for k, v := range c.Controllers {
		if v.ControllerUUID == one.ControllerUUID {
			return errors.AlreadyExistsf("controller with UUID %s (%s)",
				one.ControllerUUID, k)
		}
	}
	c.Controllers[name] = one
	return nil
}
// AddController implements ControllerUpdater.AddController
AddController implements ControllerUpdater.AddController
// AddController implements ControllerUpdater . AddController
func (c *MemStore) AddController(name string, one ControllerDetails) error {
	c.mu.Lock()
	defer c.mu.Unlock()
	if err := ValidateControllerName(name); err != nil {
		return err
	}
	if err := ValidateControllerDetails(one); err != nil {
		return err
	}
	if _, ok := c.Controllers[name]; ok {
		return errors.AlreadyExistsf("controller with name %s", name)
	}
	for k, v := range c.Controllers {
		if v.ControllerUUID == one.ControllerUUID {
			return errors.AlreadyExistsf("controller with UUID %s (%s)",
				one.ControllerUUID, k)
		}
	}
	c.Controllers[name] = one
	return nil
}
func ( c * MemStore ) AddController ( name string , one ControllerDetails ) error { c . mu . Lock ( ) defer c . mu . Unlock ( ) if err := ValidateControllerName ( name ) ; err != nil { return err } if err := ValidateControllerDetails ( one ) ; err != nil { return err } if _ , ok := c . Controllers [ name ] ; ok { return errors . AlreadyExistsf ( " " , name ) } for k , v := range c . Controllers { if v . ControllerUUID == one . ControllerUUID { return errors . AlreadyExistsf ( " " , one . ControllerUUID , k ) } } c . Controllers [ name ] = one return nil }
AddController implements ControllerUpdater.AddController
AddController implements ControllerUpdater . AddController