syncman

package
v0.0.0-...-260b785 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminSyncmanInterface

type AdminSyncmanInterface interface {
	GetInternalAccessToken() (string, error)
	IsTokenValid(ctx context.Context, token, resource, op string, attr map[string]string) (model.RequestParams, error)
	SetServices(eventType string, services model.ScServices)
	ValidateProjectSyncOperation(c *config.Config, project *config.ProjectConfig) bool
	SetIntegrationConfig(integrations config.Integrations)

	// For integrations
	GetIntegrationToken(id string) (string, error)
}

AdminSyncmanInterface is an interface consisting of functions of admin module used by eventing module

type GlobalModulesInterface

type GlobalModulesInterface interface {
	// SetMetricsConfig set the config of the metrics module
	SetMetricsConfig(isMetricsEnabled bool)
}

GlobalModulesInterface is an interface consisting of functions of the global modules

type KubeStore

type KubeStore struct {
	// contains filtered or unexported fields
}

KubeStore is an object for storing kubestore information

func NewKubeStore

func NewKubeStore(clusterID string) (*KubeStore, error)

NewKubeStore creates a new Kube store

func (*KubeStore) DeleteProject

func (s *KubeStore) DeleteProject(ctx context.Context, projectID string) error

DeleteProject deletes all the config resources which matches label projectId

func (*KubeStore) DeleteResource

func (s *KubeStore) DeleteResource(ctx context.Context, resourceID string) error

DeleteResource deletes a resource from cluster

func (*KubeStore) GetGlobalConfig

func (s *KubeStore) GetGlobalConfig() (*config.Config, error)

GetGlobalConfig gets config of all resource required by a cluster

func (*KubeStore) Register

func (s *KubeStore) Register()

Register registers space cloud to the kube store

func (*KubeStore) SetResource

func (s *KubeStore) SetResource(ctx context.Context, resourceID string, resource interface{}) error

SetResource sets the project of the kube store

func (*KubeStore) WatchResources

func (s *KubeStore) WatchResources(cb func(eventType, resourceID string, resourceType config.Resource, resource interface{})) error

WatchResources maintains consistency over all projects

func (*KubeStore) WatchServices

func (s *KubeStore) WatchServices(cb func(string, string, model.ScServices)) error

WatchServices maintains consistency over all services

type LocalStore

type LocalStore struct {
	// contains filtered or unexported fields
}

LocalStore is an object for storing localstore information

func NewLocalStore

func NewLocalStore(nodeID string, ssl *config.SSL) (*LocalStore, error)

NewLocalStore creates a new local store

func (*LocalStore) DeleteProject

func (s *LocalStore) DeleteProject(ctx context.Context, projectID string) error

DeleteProject deletes all the config resources which matches label projectId

func (*LocalStore) DeleteResource

func (s *LocalStore) DeleteResource(ctx context.Context, resourceID string) error

DeleteResource deletes the project from the local gloablConfig

func (*LocalStore) GetGlobalConfig

func (s *LocalStore) GetGlobalConfig() (*config.Config, error)

GetGlobalConfig gets config all projects

func (*LocalStore) Register

func (s *LocalStore) Register()

Register registers space cloud to the local store

func (*LocalStore) SetResource

func (s *LocalStore) SetResource(ctx context.Context, resourceID string, resource interface{}) error

SetResource sets the project of the local globalConfig

func (*LocalStore) WatchResources

func (s *LocalStore) WatchResources(cb func(eventType, resourceId string, resourceType config.Resource, resource interface{})) error

WatchResources maintains consistency over all projects

func (*LocalStore) WatchServices

func (s *LocalStore) WatchServices(cb func(string, string, model.ScServices)) error

WatchServices maintains consistency over all services

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager syncs the project config between folders

func New

func New(nodeID, clusterID, storeType, runnerAddr string, adminMan AdminSyncmanInterface, integrationMan integrationInterface, ssl *config.SSL) (*Manager, error)

New creates a new instance of the sync manager

func (*Manager) AddIntegrationHook

func (s *Manager) AddIntegrationHook(ctx context.Context, integrationID string, hookConfig *config.IntegrationHook, params model.RequestParams) (int, error)

AddIntegrationHook adds an integration hook

func (*Manager) ApplyProjectConfig

func (s *Manager) ApplyProjectConfig(ctx context.Context, project *config.ProjectConfig, params model.RequestParams) (int, error)

ApplyProjectConfig creates the config for the project

func (*Manager) CheckIfLeaderGateway

func (s *Manager) CheckIfLeaderGateway(nodeID string) (bool, error)

CheckIfLeaderGateway tells if the provided gateway is the current leader gateway or not

func (*Manager) DeleteCollectionRules

func (s *Manager) DeleteCollectionRules(ctx context.Context, project, dbAlias, col string, params model.RequestParams) (int, error)

DeleteCollectionRules deletes the collection rules of the database

func (*Manager) DeleteProjectConfig

func (s *Manager) DeleteProjectConfig(ctx context.Context, projectID string, params model.RequestParams) (int, error)

DeleteProjectConfig applies delete project config command to the raft log

func (*Manager) DeleteProjectRoute

func (s *Manager) DeleteProjectRoute(ctx context.Context, project, routeID string, params model.RequestParams) (int, error)

DeleteProjectRoute deletes a route from specified project config

func (*Manager) DeleteService

func (s *Manager) DeleteService(ctx context.Context, project, service string, params model.RequestParams) (int, error)

DeleteService deletes a remotes service

func (*Manager) DeleteUserManagement

func (s *Manager) DeleteUserManagement(ctx context.Context, project, provider string, reqParams model.RequestParams) (int, error)

DeleteUserManagement deletes the user management

func (*Manager) EnableIntegration

func (s *Manager) EnableIntegration(ctx context.Context, integrationConfig *config.IntegrationConfig, params model.RequestParams) (int, error)

EnableIntegration enables integration

func (*Manager) GetAssignedSpaceCloudID

func (s *Manager) GetAssignedSpaceCloudID(ctx context.Context, project string, token int) (string, error)

GetAssignedSpaceCloudID returns the space cloud id assigned for the provided token

func (*Manager) GetAssignedTokens

func (s *Manager) GetAssignedTokens() (start, end int)

GetAssignedTokens returns the array or tokens assigned to this node

func (*Manager) GetCacheConfig

func (s *Manager) GetCacheConfig(ctx context.Context, params model.RequestParams) (int, interface{}, error)

GetCacheConfig returns the cache config stored

func (*Manager) GetClusterConfig

func (s *Manager) GetClusterConfig(ctx context.Context, params model.RequestParams) (int, interface{}, error)

GetClusterConfig returns cluster config

func (*Manager) GetClusterID

func (s *Manager) GetClusterID() string

GetClusterID get cluster id

func (*Manager) GetClusterType

func (s *Manager) GetClusterType(ctx context.Context, admin AdminSyncmanInterface) (string, error)

GetClusterType returns cluster type

func (*Manager) GetCollectionRules

func (s *Manager) GetCollectionRules(ctx context.Context, project, dbAlias, col string, params model.RequestParams) (int, []interface{}, error)

GetCollectionRules gets collection rules

func (*Manager) GetConfig

func (s *Manager) GetConfig(projectID string) (*config.ProjectConfig, error)

GetConfig returns the config present in the state

func (*Manager) GetDatabaseConfig

func (s *Manager) GetDatabaseConfig(ctx context.Context, project, dbAlias string, params model.RequestParams) (int, []interface{}, error)

GetDatabaseConfig gets database config

func (*Manager) GetEventSource

func (s *Manager) GetEventSource() string

GetEventSource returns the source id for the space cloud instance

func (*Manager) GetEventingConfig

func (s *Manager) GetEventingConfig(ctx context.Context, project string, params model.RequestParams) (int, interface{}, error)

GetEventingConfig returns the eventing config

func (*Manager) GetEventingSchema

func (s *Manager) GetEventingSchema(ctx context.Context, project, id string, params model.RequestParams) (int, []interface{}, error)

GetEventingSchema gets eventing schema from config

func (*Manager) GetEventingSecurityRules

func (s *Manager) GetEventingSecurityRules(ctx context.Context, project, id string, params model.RequestParams) (int, []interface{}, error)

GetEventingSecurityRules gets eventing security rules from config

func (*Manager) GetEventingTriggerRules

func (s *Manager) GetEventingTriggerRules(ctx context.Context, project, id string, params model.RequestParams) (int, []interface{}, error)

GetEventingTriggerRules gets trigger rules from config

func (*Manager) GetFileStoreConfig

func (s *Manager) GetFileStoreConfig(ctx context.Context, project string, params model.RequestParams) (int, []interface{}, error)

GetFileStoreConfig gets file store config

func (*Manager) GetFileStoreRules

func (s *Manager) GetFileStoreRules(ctx context.Context, project, ruleID string, params model.RequestParams) (int, []interface{}, error)

GetFileStoreRules gets file store rules from config

func (*Manager) GetGatewayIndex

func (s *Manager) GetGatewayIndex() int

GetGatewayIndex returns the index of the current node

func (*Manager) GetGlobalConfig

func (s *Manager) GetGlobalConfig() *config.Config

GetGlobalConfig gets the global config

func (*Manager) GetGlobalRouteConfig

func (s *Manager) GetGlobalRouteConfig(ctx context.Context, project string, params model.RequestParams) (int, interface{}, error)

GetGlobalRouteConfig returns the project level ingress routing config

func (*Manager) GetIngressRouting

func (s *Manager) GetIngressRouting(ctx context.Context, project, routeID string, params model.RequestParams) (int, []interface{}, error)

GetIngressRouting gets ingress routing from config

func (*Manager) GetIntegrationHooks

func (s *Manager) GetIntegrationHooks(ctx context.Context, integrationID, hookID string, params model.RequestParams) (int, []interface{}, error)

GetIntegrationHooks gets a integration hook

func (*Manager) GetIntegrationTokens

func (s *Manager) GetIntegrationTokens(ctx context.Context, id, key string) (int, interface{}, error)

GetIntegrationTokens returns the tokens required for an integration

func (*Manager) GetIntegrations

func (s *Manager) GetIntegrations(ctx context.Context, id string, params model.RequestParams) (int, []interface{}, error)

GetIntegrations returns the list of integrations from gateway

func (*Manager) GetLetsEncryptConfig

func (s *Manager) GetLetsEncryptConfig(ctx context.Context, project string, params model.RequestParams) (int, interface{}, error)

GetLetsEncryptConfig returns the letsencrypt config for the particular project

func (*Manager) GetLogicalDatabaseName

func (s *Manager) GetLogicalDatabaseName(ctx context.Context, project, dbAlias string) (string, error)

GetLogicalDatabaseName gets logical database name for provided db alias

func (*Manager) GetNodeID

func (s *Manager) GetNodeID() string

GetNodeID returns node id assigned to sc

func (*Manager) GetNodesInCluster

func (s *Manager) GetNodesInCluster() int

GetNodesInCluster get total number of gateways

func (*Manager) GetPreparedQuery

func (s *Manager) GetPreparedQuery(ctx context.Context, project, dbAlias, id string, params model.RequestParams) (int, []interface{}, error)

GetPreparedQuery gets preparedQuery from config

func (*Manager) GetProjectConfig

func (s *Manager) GetProjectConfig(ctx context.Context, projectID string, params model.RequestParams) (int, []interface{}, error)

GetProjectConfig returns the config of specified project

func (*Manager) GetProjectRoutes

func (s *Manager) GetProjectRoutes(ctx context.Context, project string) (int, interface{}, error)

GetProjectRoutes gets all the routes for specified project config

func (*Manager) GetRealtimeURL

func (s *Manager) GetRealtimeURL(project string) string

GetRealtimeURL get the url of realtime

func (*Manager) GetRunnerAddr

func (s *Manager) GetRunnerAddr() string

GetRunnerAddr returns runner address

func (*Manager) GetSchemas

func (s *Manager) GetSchemas(ctx context.Context, project, dbAlias, col, format string, params model.RequestParams) (int, []interface{}, error)

GetSchemas gets schemas from config

func (*Manager) GetSecrets

func (s *Manager) GetSecrets(project, secretName, key string) (string, error)

GetSecrets gets secrets from runner This function should be called only from setConfig method of any module

func (*Manager) GetServices

func (s *Manager) GetServices(ctx context.Context, project, serviceID string, params model.RequestParams) (int, []interface{}, error)

GetServices gets a remotes service

func (*Manager) GetSpaceCloudNodeIDs

func (s *Manager) GetSpaceCloudNodeIDs(project string) []string

GetSpaceCloudNodeIDs returns the array of space cloud ids

func (*Manager) GetSpaceCloudPort

func (s *Manager) GetSpaceCloudPort() int

GetSpaceCloudPort returns the port sc is running on

func (*Manager) GetTokenForMissionControl

func (s *Manager) GetTokenForMissionControl(ctx context.Context, projectID string, params model.RequestParams) (int, string, error)

GetTokenForMissionControl returns the project token for internal use in mission control

func (*Manager) GetUserManagement

func (s *Manager) GetUserManagement(ctx context.Context, project, providerID string, params model.RequestParams) (int, []interface{}, error)

GetUserManagement gets user management

func (*Manager) HandleRunnerApplySecret

func (s *Manager) HandleRunnerApplySecret(admin *admin.Manager) http.HandlerFunc

HandleRunnerApplySecret handles requests of the runner

func (*Manager) HandleRunnerApplyService

func (s *Manager) HandleRunnerApplyService(admin *admin.Manager) http.HandlerFunc

HandleRunnerApplyService handles requests of the runner

func (*Manager) HandleRunnerDeleteSecret

func (s *Manager) HandleRunnerDeleteSecret(admin *admin.Manager) http.HandlerFunc

HandleRunnerDeleteSecret handles requests of the runner

func (*Manager) HandleRunnerDeleteSecretKey

func (s *Manager) HandleRunnerDeleteSecretKey(admin *admin.Manager) http.HandlerFunc

HandleRunnerDeleteSecretKey handles requests of the runner

func (*Manager) HandleRunnerDeleteService

func (s *Manager) HandleRunnerDeleteService(admin *admin.Manager) http.HandlerFunc

HandleRunnerDeleteService handles requests of the runner

func (*Manager) HandleRunnerDeleteServiceRole

func (s *Manager) HandleRunnerDeleteServiceRole(admin *admin.Manager) http.HandlerFunc

HandleRunnerDeleteServiceRole handles requests of the runner

func (*Manager) HandleRunnerGetDeploymentStatus

func (s *Manager) HandleRunnerGetDeploymentStatus(admin *admin.Manager) http.HandlerFunc

HandleRunnerGetDeploymentStatus handles requests of the runner

func (*Manager) HandleRunnerGetServiceLogs

func (s *Manager) HandleRunnerGetServiceLogs(admin *admin.Manager) http.HandlerFunc

HandleRunnerGetServiceLogs handles requests of the runner

func (*Manager) HandleRunnerGetServiceRoleRequest

func (s *Manager) HandleRunnerGetServiceRoleRequest(admin *admin.Manager) http.HandlerFunc

HandleRunnerGetServiceRoleRequest handles requests of the runner

func (*Manager) HandleRunnerGetServiceRoutingRequest

func (s *Manager) HandleRunnerGetServiceRoutingRequest(admin *admin.Manager) http.HandlerFunc

HandleRunnerGetServiceRoutingRequest handles requests of the runner

func (*Manager) HandleRunnerGetServices

func (s *Manager) HandleRunnerGetServices(admin *admin.Manager) http.HandlerFunc

HandleRunnerGetServices handles requests of the runner

func (*Manager) HandleRunnerListSecret

func (s *Manager) HandleRunnerListSecret(admin *admin.Manager) http.HandlerFunc

HandleRunnerListSecret handles requests of the runner

func (*Manager) HandleRunnerRequests

func (s *Manager) HandleRunnerRequests(admin *admin.Manager) http.HandlerFunc

HandleRunnerRequests handles requests of the runner

func (*Manager) HandleRunnerServiceRoutingRequest

func (s *Manager) HandleRunnerServiceRoutingRequest(admin *admin.Manager) http.HandlerFunc

HandleRunnerServiceRoutingRequest handles requests of the runner

func (*Manager) HandleRunnerSetFileSecretRootPath

func (s *Manager) HandleRunnerSetFileSecretRootPath(admin *admin.Manager) http.HandlerFunc

HandleRunnerSetFileSecretRootPath handles requests of the runner

func (*Manager) HandleRunnerSetSecretKey

func (s *Manager) HandleRunnerSetSecretKey(admin *admin.Manager) http.HandlerFunc

HandleRunnerSetSecretKey handles requests of the runner

func (*Manager) HandleRunnerSetServiceRole

func (s *Manager) HandleRunnerSetServiceRole(admin *admin.Manager) http.HandlerFunc

HandleRunnerSetServiceRole handles requests of the runner

func (*Manager) HealthCheck

func (s *Manager) HealthCheck() error

HealthCheck checks the health of gateway

func (*Manager) MakeHTTPRequest

func (s *Manager) MakeHTTPRequest(ctx context.Context, method, url, token, scToken string, params, vPtr interface{}) error

MakeHTTPRequest fires an http request and returns a response

func (*Manager) RemoveCollection

func (s *Manager) RemoveCollection(ctx context.Context, project, dbAlias, col string, params model.RequestParams) (int, error)

RemoveCollection removed the collection from the database collection schema in config

func (*Manager) RemoveDatabaseConfig

func (s *Manager) RemoveDatabaseConfig(ctx context.Context, project, dbAlias string, params model.RequestParams) (int, error)

RemoveDatabaseConfig removes the database config

func (*Manager) RemoveIntegration

func (s *Manager) RemoveIntegration(ctx context.Context, id string, params model.RequestParams) (int, error)

RemoveIntegration removes an integration from space cloud

func (*Manager) RemoveIntegrationHook

func (s *Manager) RemoveIntegrationHook(ctx context.Context, integrationID, hookID string, params model.RequestParams) (int, error)

RemoveIntegrationHook removes an integration hook

func (*Manager) RemovePreparedQueries

func (s *Manager) RemovePreparedQueries(ctx context.Context, project, dbAlias, id string, params model.RequestParams) (int, error)

RemovePreparedQueries removes the database PreparedQueries

func (*Manager) SetCacheConfig

func (s *Manager) SetCacheConfig(ctx context.Context, cacheConfig *config.CacheConfig, params model.RequestParams) (int, error)

SetCacheConfig sets the caching config

func (*Manager) SetClusterConfig

func (s *Manager) SetClusterConfig(ctx context.Context, req *config.ClusterConfig, params model.RequestParams) (int, error)

SetClusterConfig applies the set cluster config

func (*Manager) SetCollectionRules

func (s *Manager) SetCollectionRules(ctx context.Context, project, dbAlias, col string, v *config.DatabaseRule, params model.RequestParams) (int, error)

SetCollectionRules sets the collection rules of the database

func (*Manager) SetDatabaseConnection

func (s *Manager) SetDatabaseConnection(ctx context.Context, project, dbAlias string, v *config.DatabaseConfig, params model.RequestParams) (int, error)

SetDatabaseConnection sets the database connection

func (*Manager) SetDeleteCollection

func (s *Manager) SetDeleteCollection(ctx context.Context, project, dbAlias, col string, module *crud.Module, params model.RequestParams) (int, error)

SetDeleteCollection deletes a collection from the database

func (*Manager) SetDeleteEventingRule

func (s *Manager) SetDeleteEventingRule(ctx context.Context, project, ruleName string, params model.RequestParams) (int, error)

SetDeleteEventingRule deletes an eventing rule

func (*Manager) SetDeleteEventingSchema

func (s *Manager) SetDeleteEventingSchema(ctx context.Context, project string, evType string, params model.RequestParams) (int, error)

SetDeleteEventingSchema deletes the schema for the given event type

func (*Manager) SetDeleteEventingSecurityRules

func (s *Manager) SetDeleteEventingSecurityRules(ctx context.Context, project, evType string, params model.RequestParams) (int, error)

SetDeleteEventingSecurityRules deletes the security rule for the given event type

func (*Manager) SetDeleteFileRule

func (s *Manager) SetDeleteFileRule(ctx context.Context, project, filename string, params model.RequestParams) (int, error)

SetDeleteFileRule deletes a rule from file store

func (*Manager) SetEventingConfig

func (s *Manager) SetEventingConfig(ctx context.Context, project, dbAlias string, enabled bool, params model.RequestParams) (int, error)

SetEventingConfig sets the eventing config

func (*Manager) SetEventingRule

func (s *Manager) SetEventingRule(ctx context.Context, project, ruleName string, value *config.EventingTrigger, params model.RequestParams) (int, error)

SetEventingRule sets the eventing rules

func (*Manager) SetEventingSchema

func (s *Manager) SetEventingSchema(ctx context.Context, project string, evType string, schema string, params model.RequestParams) (int, error)

SetEventingSchema sets the schema for the given event type

func (*Manager) SetEventingSecurityRules

func (s *Manager) SetEventingSecurityRules(ctx context.Context, project, evType string, rule *config.Rule, params model.RequestParams) (int, error)

SetEventingSecurityRules sets the securtiy rule for the given event type

func (*Manager) SetFileRule

func (s *Manager) SetFileRule(ctx context.Context, project, id string, value *config.FileRule, params model.RequestParams) (int, error)

SetFileRule sets the rule for file store

func (*Manager) SetFileStore

func (s *Manager) SetFileStore(ctx context.Context, project string, value *config.FileStoreConfig, params model.RequestParams) (int, error)

SetFileStore sets the file store module

func (*Manager) SetGlobalConfig

func (s *Manager) SetGlobalConfig(c *config.Config)

SetGlobalConfig sets the global config. This must be called before the Start command.

func (*Manager) SetGlobalModules

func (s *Manager) SetGlobalModules(a GlobalModulesInterface)

SetGlobalModules sets all the modules

func (*Manager) SetGlobalRouteConfig

func (s *Manager) SetGlobalRouteConfig(ctx context.Context, project string, globalConfig *config.GlobalRoutesConfig, params model.RequestParams) (int, error)

SetGlobalRouteConfig sets the project level ingress routing config

func (*Manager) SetModifyAllSchema

func (s *Manager) SetModifyAllSchema(ctx context.Context, dbAlias, project string, v config.CrudStub, params model.RequestParams) (int, error)

SetModifyAllSchema modifies schema of all tables

func (*Manager) SetModifySchema

func (s *Manager) SetModifySchema(ctx context.Context, project, dbAlias, col string, v *config.DatabaseSchema, params model.RequestParams) (int, error)

SetModifySchema modifies the schema of table

func (*Manager) SetModules

func (s *Manager) SetModules(modulesInterface ModulesInterface)

SetModules sets all the modules

func (*Manager) SetPreparedQueries

func (s *Manager) SetPreparedQueries(ctx context.Context, project, dbAlias, id string, v *config.DatbasePreparedQuery, params model.RequestParams) (int, error)

SetPreparedQueries sets database preparedqueries

func (*Manager) SetProjectLetsEncryptDomains

func (s *Manager) SetProjectLetsEncryptDomains(ctx context.Context, project string, c *config.LetsEncrypt, params model.RequestParams) (int, error)

SetProjectLetsEncryptDomains sets a projects whitelisted domains

func (*Manager) SetProjectRoute

func (s *Manager) SetProjectRoute(ctx context.Context, project, id string, c *config.Route, params model.RequestParams) (int, error)

SetProjectRoute adds a route in specified project config

func (*Manager) SetProjectRoutes

func (s *Manager) SetProjectRoutes(ctx context.Context, project string, c config.Routes) (int, error)

SetProjectRoutes sets a projects routes

func (*Manager) SetReloadSchema

func (s *Manager) SetReloadSchema(ctx context.Context, dbAlias, project string, params model.RequestParams) (int, error)

SetReloadSchema reloads of the schema

func (*Manager) SetSchemaInspection

func (s *Manager) SetSchemaInspection(ctx context.Context, project, dbAlias, col string, params model.RequestParams) (int, error)

SetSchemaInspection inspects the schema

func (*Manager) SetService

func (s *Manager) SetService(ctx context.Context, project, service string, value *config.Service, params model.RequestParams) (int, error)

SetService adds a remote service

func (*Manager) SetUserManagement

func (s *Manager) SetUserManagement(ctx context.Context, project, provider string, value *config.AuthStub, reqParams model.RequestParams) (int, error)

SetUserManagement sets the user management

func (*Manager) Start

func (s *Manager) Start(port int) error

Start begins the sync manager operations

type ModulesInterface

type ModulesInterface interface {
	// SetInitialProjectConfig sets the config all modules
	SetInitialProjectConfig(ctx context.Context, config config.Projects) error

	// SetProjectConfig sets specific project config
	SetProjectConfig(ctx context.Context, config *config.ProjectConfig) error

	// SetDatabaseConfig sets the config of crud, auth, schema and realtime modules
	SetDatabaseConfig(ctx context.Context, projectID string, databaseConfigs config.DatabaseConfigs, schemaConfigs config.DatabaseSchemas, ruleConfigs config.DatabaseRules, prepConfigs config.DatabasePreparedQueries) error
	SetDatabaseSchemaConfig(ctx context.Context, projectID string, schemaConfigs config.DatabaseSchemas) error
	SetDatabaseRulesConfig(ctx context.Context, projectID string, ruleConfigs config.DatabaseRules) error
	SetDatabasePreparedQueryConfig(ctx context.Context, projectID string, prepConfigs config.DatabasePreparedQueries) error

	// SetFileStoreConfig sets the config of auth and filestore modules
	SetFileStoreConfig(ctx context.Context, projectID string, fileStore *config.FileStoreConfig) error
	SetFileStoreSecurityRuleConfig(ctx context.Context, projectID string, fileRule config.FileStoreRules) error

	// SetServicesConfig sets the config of auth and functions modules
	SetRemoteServiceConfig(ctx context.Context, projectID string, services config.Services) error

	SetLetsencryptConfig(ctx context.Context, projectID string, c *config.LetsEncrypt) error

	SetIngressRouteConfig(ctx context.Context, projectID string, routes config.IngressRoutes) error
	SetIngressGlobalRouteConfig(ctx context.Context, projectID string, c *config.GlobalRoutesConfig) error

	// SetEventingConfig sets the config of eventing module
	SetEventingConfig(ctx context.Context, projectID string, eventingConfig *config.EventingConfig, secureObj config.EventingRules, eventingSchemas config.EventingSchemas, eventingTriggers config.EventingTriggers) error
	SetEventingSchemaConfig(ctx context.Context, projectID string, schemaObj config.EventingSchemas) error
	SetEventingTriggerConfig(ctx context.Context, projectID string, triggerObj config.EventingTriggers) error
	SetEventingRuleConfig(ctx context.Context, projectID string, secureObj config.EventingRules) error

	// SetUsermanConfig set the config of the userman module
	SetUsermanConfig(ctx context.Context, projectID string, auth config.Auths) error

	// Getters
	GetSchemaModuleForSyncMan(projectID string) (model.SchemaEventingInterface, error)
	GetAuthModuleForSyncMan(projectID string) (model.AuthSyncManInterface, error)
	LetsEncrypt() *letsencrypt.LetsEncrypt
	Routing() *routing.Routing
	Caching() *caching.Cache

	// Delete
	Delete(projectID string)
}

ModulesInterface is an interface consisting of functions of the modules module used by syncman

type Store

type Store interface {
	WatchServices(cb func(eventType string, serviceID string, projects model.ScServices)) error
	WatchResources(cb func(eventType, resourceId string, resourceType config.Resource, resource interface{})) error

	Register()

	SetResource(ctx context.Context, resourceID string, resource interface{}) error
	DeleteResource(ctx context.Context, resourceID string) error

	// This function should only be used by delete project endpoint
	DeleteProject(ctx context.Context, projectID string) error

	GetGlobalConfig() (*config.Config, error)
}

Store abstracts the implementation of letsencrypt storage operations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL