syncman

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncManager

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

SyncManager syncs the project config between folders

func New

func New(adminMan *admin.Manager) *SyncManager

New creates a new instance of the sync manager

func (*SyncManager) Apply

func (s *SyncManager) Apply(l *raft.Log) interface{}

Apply applies a Raft log entry to the key-value store

func (*SyncManager) DeleteProjectConfig

func (s *SyncManager) DeleteProjectConfig(token, projectID string) error

DeleteProjectConfig applies delete project config command to the raft log

func (*SyncManager) GetClusterSize added in v0.10.1

func (s *SyncManager) GetClusterSize() int

GetClusterSize returns the size of the cluster

func (*SyncManager) GetConfig

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

GetConfig returns the config present in the state

func (*SyncManager) GetGlobalConfig

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

GetGlobalConfig gets the global config

func (*SyncManager) Restore

func (s *SyncManager) Restore(rc io.ReadCloser) error

Restore stores the key-value store to a previous state.

func (*SyncManager) SetGlobalConfig

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

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

func (*SyncManager) SetProjectConfig

func (s *SyncManager) SetProjectConfig(token string, project *config.Project) error

SetProjectConfig applies the set project config command to the raft log

func (*SyncManager) Snapshot

func (s *SyncManager) Snapshot() (raft.FSMSnapshot, error)

Snapshot returns a snapshot of the key-value store.

func (*SyncManager) Start

func (s *SyncManager) Start(nodeID, configFilePath, gossipPort, raftPort string, seeds []string, cb func(*config.Config) error) error

Start begins the sync manager operations

Jump to

Keyboard shortcuts

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