syncman

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulStore added in v0.15.0

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

func NewConsulStore added in v0.15.0

func NewConsulStore(nodeID, clusterID, advertiseAddr string) (*ConsulStore, error)

func (*ConsulStore) DeleteProject added in v0.15.0

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

func (*ConsulStore) Register added in v0.15.0

func (s *ConsulStore) Register()

func (*ConsulStore) SetProject added in v0.15.0

func (s *ConsulStore) SetProject(ctx context.Context, project *config.Project) error

func (*ConsulStore) WatchProjects added in v0.15.0

func (s *ConsulStore) WatchProjects(cb func(projects []*config.Project)) error

func (*ConsulStore) WatchServices added in v0.15.0

func (s *ConsulStore) WatchServices(cb func(scServices)) error

type ETCDStore added in v0.15.0

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

func NewETCDStore added in v0.15.0

func NewETCDStore(nodeID, clusterID, advertiseAddr string) (*ETCDStore, error)

func (*ETCDStore) DeleteProject added in v0.15.0

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

func (*ETCDStore) Register added in v0.15.0

func (s *ETCDStore) Register()

func (*ETCDStore) SetProject added in v0.15.0

func (s *ETCDStore) SetProject(ctx context.Context, project *config.Project) error

func (*ETCDStore) WatchProjects added in v0.15.0

func (s *ETCDStore) WatchProjects(cb func(projects []*config.Project)) error

func (*ETCDStore) WatchServices added in v0.15.0

func (s *ETCDStore) WatchServices(cb func(scServices)) error

type Manager added in v0.13.0

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

Manager syncs the project config between folders

func New

func New(nodeID, clusterID, advertiseAddr, storeType string) (*Manager, error)

New creates a new instance of the sync manager

func (*Manager) CreateProjectConfig added in v0.13.0

func (s *Manager) CreateProjectConfig(ctx context.Context, project *config.Project) (error, int)

func (*Manager) DeleteProjectConfig added in v0.13.0

func (s *Manager) DeleteProjectConfig(ctx context.Context, projectID string) error

DeleteProjectConfig applies delete project config command to the raft log

func (*Manager) GetAssignedSpaceCloudURL added in v0.13.0

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

GetAssignedSpaceCloudURL returns the space cloud url assigned for the provided token

func (*Manager) GetAssignedTokens added in v0.13.0

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

GetAssignedTokens returns the array or tokens assigned to this node

func (*Manager) GetClusterSize added in v0.13.0

func (s *Manager) GetClusterSize(ctxParent context.Context) (int, error)

GetClusterSize returns the size of the cluster

func (*Manager) GetConfig added in v0.13.0

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

GetConfig returns the config present in the state

func (*Manager) GetEventSource added in v0.13.0

func (s *Manager) GetEventSource() string

GetEventSource returns the source id for the space cloud instance

func (*Manager) GetGlobalConfig added in v0.13.0

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

GetGlobalConfig gets the global config

func (*Manager) GetRealtimeUrl added in v0.15.0

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

func (*Manager) GetSpaceCloudNodeURLs added in v0.13.0

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

GetSpaceCloudNodeURLs returns the array of space cloud urls

func (*Manager) MakeHTTPRequest added in v0.13.0

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) RemoveDatabaseConfig added in v0.15.0

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

func (*Manager) SetCollectionRules added in v0.13.0

func (s *Manager) SetCollectionRules(ctx context.Context, project, dbType, col string, v *config.TableRule) error

func (*Manager) SetDatabaseConnection added in v0.13.0

func (s *Manager) SetDatabaseConnection(ctx context.Context, project, dbType string, v config.CrudStub) error

func (*Manager) SetDeleteCollection added in v0.13.0

func (s *Manager) SetDeleteCollection(ctx context.Context, project, dbType, col string) error

func (*Manager) SetDeleteEventingRule added in v0.13.0

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

func (*Manager) SetDeleteFileRule added in v0.13.0

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

func (*Manager) SetDeleteService added in v0.13.0

func (s *Manager) SetDeleteService(ctx context.Context, project, service string) error

func (*Manager) SetEventingConfig added in v0.13.0

func (s *Manager) SetEventingConfig(ctx context.Context, project, dbType, col string, enabled bool) error

func (*Manager) SetEventingRule added in v0.13.0

func (s *Manager) SetEventingRule(ctx context.Context, project, ruleName string, value config.EventingRule) error

func (*Manager) SetFileRule added in v0.13.0

func (s *Manager) SetFileRule(ctx context.Context, project string, value *config.FileRule) error

func (*Manager) SetFileStore added in v0.13.0

func (s *Manager) SetFileStore(ctx context.Context, project string, value *config.FileStore) error

func (*Manager) SetGlobalConfig added in v0.13.0

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

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

func (*Manager) SetModifyAllSchema added in v0.13.0

func (s *Manager) SetModifyAllSchema(ctx context.Context, dbType, project string, schemaArg *schema.Schema, v config.CrudStub) error

func (*Manager) SetModifySchema added in v0.13.0

func (s *Manager) SetModifySchema(ctx context.Context, project, dbType, col, schema string) error

func (*Manager) SetProjectConfig added in v0.13.0

func (s *Manager) SetProjectConfig(ctx context.Context, project *config.Project) error

SetProjectConfig applies the set project config command to the raft log

func (*Manager) SetProjectGlobalConfig added in v0.13.0

func (s *Manager) SetProjectGlobalConfig(ctx context.Context, project *config.Project) error

SetProjectGlobalConfig applies the set project config command to the raft log

func (*Manager) SetReloadSchema added in v0.13.0

func (s *Manager) SetReloadSchema(ctx context.Context, dbType, project string, schemaArg *schema.Schema) (map[string]interface{}, error)

func (*Manager) SetSchemaInspection added in v0.13.0

func (s *Manager) SetSchemaInspection(ctx context.Context, project, dbType, col, schema string) error

func (*Manager) SetService added in v0.13.0

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

func (*Manager) SetUserManagement added in v0.13.0

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

func (*Manager) Start added in v0.13.0

func (s *Manager) Start(configFilePath string, cb func(*config.Config) error, port int) error

Start begins the sync manager operations

type Store added in v0.15.0

type Store interface {
	WatchProjects(cb func(projects []*config.Project)) error
	WatchServices(cb func(projects scServices)) error

	Register()

	SetProject(ctx context.Context, project *config.Project) error
	DeleteProject(ctx context.Context, projectID string) error
}

Jump to

Keyboard shortcuts

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