code: func (s *Store) AddService(service string, config *discoverd.ServiceConfig) error {
  	if config == nil {
  		config = DefaultServiceConfig
  	}
  
  	// Serialize command.
  	cmd, err := json.Marshal(&addServiceCommand{
  		Service: service,
  		Config:  config,
  	})
  	if err != nil {
  		return err
  	}
  
  	if _, err := s.raftApply(addServiceCommandType, cmd); err != nil {
  		return err
  	}
  	return err
  }
docs: // AddService creates a service with a configuration.
  // Returns an error if the service already exists.