func (s *LocalStore) SetResource(ctx context.Context, resourceID string, resource interface{}) error {
	if err := updateResource(ctx, config.ResourceAddEvent, s.globalConfig, resourceID, "", resource); err != nil {
		return err
	}
	return config.StoreConfigToFile(s.globalConfig, s.configPath)
}
SetResource sets the project of the local globalConfig
package syncman
import (
	"os"
	"golang.org/x/net/context"
	"github.com/spaceuptech/space-cloud/gateway/config"
	"github.com/spaceuptech/space-cloud/gateway/model"
)
type LocalStore struct {
	configPath   string
	globalConfig *config.Config
	services     model.ScServices
}
func NewLocalStore(nodeID string, ssl *config.SSL) (*LocalStore, error) {
	configPath := os.Getenv("CONFIG")
	if configPath == "" {
		configPath = "config.yaml"
	}
	conf, err := config.LoadConfigFromFile(configPath)
	if err != nil {
		conf = config.GenerateEmptyConfig()
	}
	if conf.ClusterConfig == nil {
		conf.ClusterConfig = &config.ClusterConfig{EnableTelemetry: true}
	}
	if ssl.Enabled {
		conf.SSL = ssl
	}
	services := model.ScServices{}
	return &LocalStore{configPath: configPath, globalConfig: conf, services: append(services, &model.Service{ID: "single-node-cluster"})}, nil
}
func (s *LocalStore) Register() {}
func (s *LocalStore) WatchResources(cb func(eventType, resourceId string, resourceType config.Resource, resource interface{})) error {
	return nil
}
func (s *LocalStore) WatchServices(cb func(string, string, model.ScServices)) error {
	cb(config.ResourceAddEvent, s.services[0].ID, s.services)
	return nil
}