Documentation
¶
Index ¶
- Constants
- Variables
- func CreateRemoteRepoURI(instanceUrl string) (string, error)
- func GetRepoConfig(store RemoteConfigStore, instanceID, repoID string) (*v1.RemoteRepo, error)
- func InstanceForBackrestURI(repoUri string) (string, error)
- func IsBackrestRemoteRepoURI(repoUri string) bool
- func RepoForBackrestURI(repoUri string) (string, error)
- type BackrestSyncHandler
- type Identity
- type RemoteConfigStore
- type SyncClient
- type SyncManager
Constants ¶
View Source
const SyncProtocolVersion = 1
Variables ¶
View Source
var ErrNotBackrestURI = errors.New("not a backrest URI")
View Source
var (
ErrRemoteConfigNotFound = errors.New("remote config not found")
)
Functions ¶
func CreateRemoteRepoURI ¶
func GetRepoConfig ¶
func GetRepoConfig(store RemoteConfigStore, instanceID, repoID string) (*v1.RemoteRepo, error)
func InstanceForBackrestURI ¶
func IsBackrestRemoteRepoURI ¶
func RepoForBackrestURI ¶
Types ¶
type BackrestSyncHandler ¶
type BackrestSyncHandler struct { v1connect.UnimplementedBackrestSyncServiceHandler // contains filtered or unexported fields }
func NewBackrestSyncHandler ¶
func NewBackrestSyncHandler(mgr *SyncManager) *BackrestSyncHandler
func (*BackrestSyncHandler) Sync ¶
func (h *BackrestSyncHandler) Sync(ctx context.Context, stream *connect.BidiStream[v1.SyncStreamItem, v1.SyncStreamItem]) error
type Identity ¶
type Identity struct { InstanceID string // contains filtered or unexported fields }
func NewIdentity ¶
func (*Identity) VerifySignature ¶
type RemoteConfigStore ¶
type RemoteConfigStore interface { // Get a remote config for the given instance ID. Get(instanceID string) (*v1.RemoteConfig, error) // Update or create a remote config for the given instance ID. Update(instanceID string, config *v1.RemoteConfig) error // Delete a remote config for the given instance ID. Delete(instanceID string) error }
func NewJSONDirRemoteConfigStore ¶
func NewJSONDirRemoteConfigStore(dir string) RemoteConfigStore
type SyncClient ¶
type SyncClient struct {
// contains filtered or unexported fields
}
func NewSyncClient ¶
func NewSyncClient(mgr *SyncManager, localInstanceID string, peer *v1.Multihost_Peer, oplog *oplog.OpLog) (*SyncClient, error)
func (*SyncClient) GetConnectionState ¶
func (c *SyncClient) GetConnectionState() (v1.SyncConnectionState, string)
func (*SyncClient) RunSync ¶
func (c *SyncClient) RunSync(ctx context.Context)
type SyncManager ¶
type SyncManager struct {
// contains filtered or unexported fields
}
func NewSyncManager ¶
func NewSyncManager(configMgr *config.ConfigManager, remoteConfigStore RemoteConfigStore, oplog *oplog.OpLog, orchestrator *orchestrator.Orchestrator) *SyncManager
func (*SyncManager) GetSyncClients ¶
func (m *SyncManager) GetSyncClients() map[string]*SyncClient
GetSyncClients returns a copy of the sync clients map. This makes the map safe to read from concurrently.
func (*SyncManager) RunSync ¶
func (m *SyncManager) RunSync(ctx context.Context)
Note: top level function will be called holding the lock, must kick off goroutines and then return.
Click to show internal directories.
Click to hide internal directories.