Documentation ¶
Index ¶
- Variables
- func HousekeepCaches()
- func HousekeepStaging()
- func ServeEndpoint(connection net.Conn) error
- type Configuration
- func (*Configuration) Descriptor() ([]byte, []int)
- func (c *Configuration) EnsureValid(source ConfigurationSource) error
- func (m *Configuration) GetDefaultIgnores() []string
- func (m *Configuration) GetIgnoreVCSMode() sync.IgnoreVCSMode
- func (m *Configuration) GetIgnores() []string
- func (m *Configuration) GetSymlinkMode() sync.SymlinkMode
- func (m *Configuration) GetWatchMode() filesystem.WatchMode
- func (m *Configuration) GetWatchPollingInterval() uint32
- func (*Configuration) ProtoMessage()
- func (m *Configuration) Reset()
- func (m *Configuration) String() string
- func (m *Configuration) XXX_DiscardUnknown()
- func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Configuration) XXX_Merge(src proto.Message)
- func (m *Configuration) XXX_Size() int
- func (m *Configuration) XXX_Unmarshal(b []byte) error
- type ConfigurationSource
- type Manager
- func (m *Manager) Create(alpha, beta *url.URL, configuration *Configuration, prompter string) (string, error)
- func (m *Manager) List(previousStateIndex uint64, specifications []string) (uint64, []*State, error)
- func (m *Manager) Pause(specifications []string) error
- func (m *Manager) Resume(specifications []string, prompter string) error
- func (m *Manager) Shutdown()
- func (m *Manager) Terminate(specifications []string) error
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (s *Session) EnsureValid() error
- func (m *Session) GetAlpha() *url.URL
- func (m *Session) GetBeta() *url.URL
- func (m *Session) GetConfiguration() *Configuration
- func (m *Session) GetCreatingVersionMajor() uint32
- func (m *Session) GetCreatingVersionMinor() uint32
- func (m *Session) GetCreatingVersionPatch() uint32
- func (m *Session) GetCreationTime() *timestamp.Timestamp
- func (m *Session) GetIdentifier() string
- func (m *Session) GetPaused() bool
- func (m *Session) GetVersion() Version
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) String() string
- func (m *Session) XXX_DiscardUnknown()
- func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Session) XXX_Merge(src proto.Message)
- func (m *Session) XXX_Size() int
- func (m *Session) XXX_Unmarshal(b []byte) error
- type State
- func (s *State) Copy() *State
- func (*State) Descriptor() ([]byte, []int)
- func (s *State) EnsureValid() error
- func (m *State) GetAlphaConnected() bool
- func (m *State) GetAlphaProblems() []*sync.Problem
- func (m *State) GetBetaConnected() bool
- func (m *State) GetBetaProblems() []*sync.Problem
- func (m *State) GetConflicts() []*sync.Conflict
- func (m *State) GetLastError() string
- func (m *State) GetSession() *Session
- func (m *State) GetStagingStatus() *rsync.ReceiverStatus
- func (m *State) GetStatus() Status
- func (m *State) GetSuccessfulSynchronizationCycles() uint64
- func (*State) ProtoMessage()
- func (m *State) Reset()
- func (m *State) String() string
- func (m *State) XXX_DiscardUnknown()
- func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *State) XXX_Merge(src proto.Message)
- func (m *State) XXX_Size() int
- func (m *State) XXX_Unmarshal(b []byte) error
- type Status
- type Version
Constants ¶
This section is empty.
Variables ¶
var Status_name = map[int32]string{
0: "Disconnected",
1: "HaltedOnRootDeletion",
2: "HaltedOnRootTypeChange",
3: "ConnectingAlpha",
4: "ConnectingBeta",
5: "Watching",
6: "ScanningAlpha",
7: "ScanningBeta",
8: "WaitingForRescan",
9: "Reconciling",
10: "StagingAlpha",
11: "StagingBeta",
12: "TransitioningAlpha",
13: "TransitioningBeta",
14: "Saving",
}
var Status_value = map[string]int32{
"Disconnected": 0,
"HaltedOnRootDeletion": 1,
"HaltedOnRootTypeChange": 2,
"ConnectingAlpha": 3,
"ConnectingBeta": 4,
"Watching": 5,
"ScanningAlpha": 6,
"ScanningBeta": 7,
"WaitingForRescan": 8,
"Reconciling": 9,
"StagingAlpha": 10,
"StagingBeta": 11,
"TransitioningAlpha": 12,
"TransitioningBeta": 13,
"Saving": 14,
}
var Version_name = map[int32]string{
0: "Invalid",
1: "Version1",
}
var Version_value = map[string]int32{
"Invalid": 0,
"Version1": 1,
}
Functions ¶
func HousekeepCaches ¶
func HousekeepCaches()
func HousekeepStaging ¶
func HousekeepStaging()
func ServeEndpoint ¶
TODO: Document that the provided streams should be closed (in a manner that unblocks them) when the function returns in order to ensure that all Goroutines have exited (they could be blocked in encodes/decodes - we only exit after the first fails). We could try to pass in a io.Closer here, but in the agent it would have to be closing standard input/output/error, and OS pipes can (depending on the platform) block on close if you try to close while in a read or write, so it's better that the caller just ensures the streams are closed, in this case by exiting the process.
Types ¶
type Configuration ¶
type Configuration struct { // SymlinkMode specifies the symlink mode that should be used in // synchronization. SymlinkMode sync.SymlinkMode `protobuf:"varint,1,opt,name=symlinkMode,enum=sync.SymlinkMode" json:"symlinkMode,omitempty"` // WatchMode specifies the filesystem watching mode. WatchMode filesystem.WatchMode `protobuf:"varint,21,opt,name=watchMode,enum=filesystem.WatchMode" json:"watchMode,omitempty"` // WatchPollingInterval specifies the interval (in seconds) for poll-based // file monitoring. A value of 0 specifies that the default interval should // be used. WatchPollingInterval uint32 `protobuf:"varint,22,opt,name=watchPollingInterval" json:"watchPollingInterval,omitempty"` // DefaultIgnores specifies the ignore patterns brought in from the global // configuration. DefaultIgnores []string `protobuf:"bytes,31,rep,name=defaultIgnores" json:"defaultIgnores,omitempty"` // Ignores specifies the ignore patterns brought in from the create request. Ignores []string `protobuf:"bytes,32,rep,name=ignores" json:"ignores,omitempty"` // IgnoreVCSMode specifies the VCS ignore mode that should be used in // synchronization. IgnoreVCSMode sync.IgnoreVCSMode `protobuf:"varint,33,opt,name=ignoreVCSMode,enum=sync.IgnoreVCSMode" json:"ignoreVCSMode,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Configuration encodes session configuration parameters. It is used for create commands to specify configuration options, for loading global configuration options, and for storing a merged configuration inside sessions.
func MergeConfigurations ¶
func MergeConfigurations(session, global *Configuration) *Configuration
MergeConfigurations merges a per-session and global configuration, allowing the per-session configuration to merge with or override the global configuration.
func (*Configuration) Descriptor ¶
func (*Configuration) Descriptor() ([]byte, []int)
func (*Configuration) EnsureValid ¶
func (c *Configuration) EnsureValid(source ConfigurationSource) error
func (*Configuration) GetDefaultIgnores ¶
func (m *Configuration) GetDefaultIgnores() []string
func (*Configuration) GetIgnoreVCSMode ¶
func (m *Configuration) GetIgnoreVCSMode() sync.IgnoreVCSMode
func (*Configuration) GetIgnores ¶
func (m *Configuration) GetIgnores() []string
func (*Configuration) GetSymlinkMode ¶
func (m *Configuration) GetSymlinkMode() sync.SymlinkMode
func (*Configuration) GetWatchMode ¶
func (m *Configuration) GetWatchMode() filesystem.WatchMode
func (*Configuration) GetWatchPollingInterval ¶
func (m *Configuration) GetWatchPollingInterval() uint32
func (*Configuration) ProtoMessage ¶
func (*Configuration) ProtoMessage()
func (*Configuration) Reset ¶
func (m *Configuration) Reset()
func (*Configuration) String ¶
func (m *Configuration) String() string
func (*Configuration) XXX_DiscardUnknown ¶
func (m *Configuration) XXX_DiscardUnknown()
func (*Configuration) XXX_Marshal ¶
func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Configuration) XXX_Merge ¶
func (dst *Configuration) XXX_Merge(src proto.Message)
func (*Configuration) XXX_Size ¶
func (m *Configuration) XXX_Size() int
func (*Configuration) XXX_Unmarshal ¶
func (m *Configuration) XXX_Unmarshal(b []byte) error
type ConfigurationSource ¶
type ConfigurationSource uint8
configurationSource represents the source of a configuration object.
const ( // configurationSourceSession specifies that a configuration object came // from a session object stored on disk. ConfigurationSourceSession ConfigurationSource = iota // configurationSourceGlobal specifies that a configuration object was // loaded from the global configuration file. ConfigurationSourceGlobal // configurationSourceCreate specifies that a configuration object came from // a create RPC request. ConfigurationSourceCreate )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides session management facilities for the daemon. Its methods are safe for concurrent usage, so it can be easily exported via an RPC interface.
func NewManager ¶
type Session ¶
type Session struct { Identifier string `protobuf:"bytes,1,opt,name=identifier" json:"identifier,omitempty"` Version Version `protobuf:"varint,2,opt,name=version,enum=session.Version" json:"version,omitempty"` CreationTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creationTime" json:"creationTime,omitempty"` CreatingVersionMajor uint32 `protobuf:"varint,4,opt,name=creatingVersionMajor" json:"creatingVersionMajor,omitempty"` CreatingVersionMinor uint32 `protobuf:"varint,5,opt,name=creatingVersionMinor" json:"creatingVersionMinor,omitempty"` CreatingVersionPatch uint32 `protobuf:"varint,6,opt,name=creatingVersionPatch" json:"creatingVersionPatch,omitempty"` Alpha *url.URL `protobuf:"bytes,7,opt,name=alpha" json:"alpha,omitempty"` Beta *url.URL `protobuf:"bytes,8,opt,name=beta" json:"beta,omitempty"` Configuration *Configuration `protobuf:"bytes,9,opt,name=configuration" json:"configuration,omitempty"` Paused bool `protobuf:"varint,10,opt,name=paused" json:"paused,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Session) Descriptor ¶
func (*Session) EnsureValid ¶
func (*Session) GetConfiguration ¶
func (m *Session) GetConfiguration() *Configuration
func (*Session) GetCreatingVersionMajor ¶
func (*Session) GetCreatingVersionMinor ¶
func (*Session) GetCreatingVersionPatch ¶
func (*Session) GetCreationTime ¶
func (*Session) GetIdentifier ¶
func (*Session) GetVersion ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) XXX_DiscardUnknown ¶
func (m *Session) XXX_DiscardUnknown()
func (*Session) XXX_Marshal ¶
func (*Session) XXX_Unmarshal ¶
type State ¶
type State struct { Session *Session `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,enum=session.Status" json:"status,omitempty"` AlphaConnected bool `protobuf:"varint,3,opt,name=alphaConnected" json:"alphaConnected,omitempty"` BetaConnected bool `protobuf:"varint,4,opt,name=betaConnected" json:"betaConnected,omitempty"` LastError string `protobuf:"bytes,5,opt,name=lastError" json:"lastError,omitempty"` SuccessfulSynchronizationCycles uint64 `protobuf:"varint,6,opt,name=successfulSynchronizationCycles" json:"successfulSynchronizationCycles,omitempty"` StagingStatus *rsync.ReceiverStatus `protobuf:"bytes,7,opt,name=stagingStatus" json:"stagingStatus,omitempty"` Conflicts []*sync.Conflict `protobuf:"bytes,8,rep,name=conflicts" json:"conflicts,omitempty"` AlphaProblems []*sync.Problem `protobuf:"bytes,9,rep,name=alphaProblems" json:"alphaProblems,omitempty"` BetaProblems []*sync.Problem `protobuf:"bytes,10,rep,name=betaProblems" json:"betaProblems,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*State) Descriptor ¶
func (*State) EnsureValid ¶
func (*State) GetAlphaConnected ¶
func (*State) GetAlphaProblems ¶
func (*State) GetBetaConnected ¶
func (*State) GetBetaProblems ¶
func (*State) GetConflicts ¶
func (*State) GetLastError ¶
func (*State) GetSession ¶
func (*State) GetStagingStatus ¶
func (m *State) GetStagingStatus() *rsync.ReceiverStatus
func (*State) GetSuccessfulSynchronizationCycles ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) XXX_DiscardUnknown ¶
func (m *State) XXX_DiscardUnknown()
func (*State) XXX_Marshal ¶
func (*State) XXX_Unmarshal ¶
type Status ¶
type Status int32
const ( Status_Disconnected Status = 0 Status_HaltedOnRootDeletion Status = 1 Status_HaltedOnRootTypeChange Status = 2 Status_ConnectingAlpha Status = 3 Status_ConnectingBeta Status = 4 Status_Watching Status = 5 Status_ScanningAlpha Status = 6 Status_ScanningBeta Status = 7 Status_WaitingForRescan Status = 8 Status_Reconciling Status = 9 Status_StagingAlpha Status = 10 Status_StagingBeta Status = 11 Status_TransitioningAlpha Status = 12 Status_TransitioningBeta Status = 13 Status_Saving Status = 14 )
func (Status) Description ¶
func (Status) EnumDescriptor ¶
type Version ¶
type Version int32
Version specifies a session version, providing default behavior that can vary without affecting existing sessions.
func (Version) DefaultIgnoreVCSMode ¶
func (v Version) DefaultIgnoreVCSMode() sync.IgnoreVCSMode
func (Version) DefaultSymlinkMode ¶
func (v Version) DefaultSymlinkMode() sync.SymlinkMode
func (Version) DefaultWatchMode ¶
func (v Version) DefaultWatchMode() filesystem.WatchMode