func (s *Manager) DeleteService(ctx context.Context, project, service string, params model.RequestParams) (int, error) {
	hookResponse := s.integrationMan.InvokeHook(ctx, params)
	if hookResponse.CheckResponse() {
		if err := hookResponse.Error(); err != nil {
			return hookResponse.Status(), err
		}
		return hookResponse.Status(), nil
	}
	s.lock.Lock()
	defer s.lock.Unlock()
	projectConfig, err := s.getConfigWithoutLock(ctx, project)
	if err != nil {
		return http.StatusBadRequest, err
	}
	resourceID := config.GenerateResourceID(s.clusterID, project, config.ResourceRemoteService, service)
	delete(projectConfig.RemoteService, resourceID)
	if err := s.modules.SetRemoteServiceConfig(ctx, project, projectConfig.RemoteService); err != nil {
		return http.StatusInternalServerError, err
	}
	if err := s.store.DeleteResource(ctx, resourceID); err != nil {
		return http.StatusInternalServerError, err
	}
	return http.StatusOK, nil
}
DeleteService deletes a remotes service
package syncman
import (
	"context"
	"fmt"
	"net/http"
	"github.com/spaceuptech/helpers"
	"github.com/spaceuptech/space-cloud/gateway/config"
	"github.com/spaceuptech/space-cloud/gateway/model"
)
func (s *Manager) SetService(ctx context.Context, project, service string, value *config.Service, params model.RequestParams) (int, error) {
	hookResponse := s.integrationMan.InvokeHook(ctx, params)
	if hookResponse.CheckResponse() {
		if err := hookResponse.Error(); err != nil {
			return hookResponse.Status(), err
		}
		return hookResponse.Status(), nil
	}
	s.lock.Lock()
	defer s.lock.Unlock()
	value.ID = service
	projectConfig, err := s.getConfigWithoutLock(ctx, project)
	if err != nil {
		return http.StatusBadRequest, err
	}
	resourceID := config.GenerateResourceID(s.clusterID, project, config.ResourceRemoteService, service)
	if projectConfig.RemoteService == nil {
		projectConfig.RemoteService = config.Services{resourceID: value}
	} else {
		projectConfig.RemoteService[resourceID] = value
	}
	if err := s.modules.SetRemoteServiceConfig(ctx, project, projectConfig.RemoteService); err != nil {
		return http.StatusInternalServerError, err
	}
	if err := s.store.SetResource(ctx, resourceID, value); err != nil {
		return http.StatusInternalServerError, err
	}
	return http.StatusOK, nil
}