Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangedFile ¶
type ChangedFile struct {
Path string // relative path within the store (e.g. "ssh/config")
Action FileAction // how the file was changed
}
ChangedFile represents a single file affected by a sync operation.
type Config ¶
type Config struct {
StoreDir string // local store directory path
Repo string // git repository URL
Branch string // git branch name
}
Config holds the configuration needed to initialize a remote.
type FileAction ¶
type FileAction string
FileAction describes how a file was changed during sync.
const ( FileAdded FileAction = "added" FileModified FileAction = "modified" FileDeleted FileAction = "deleted" )
type GitRemote ¶
type GitRemote struct {
// contains filtered or unexported fields
}
GitRemote implements Remote using a git repository via go-git.
func NewGitRemote ¶
func NewGitRemote() *GitRemote
NewGitRemote creates a new uninitialized GitRemote. Call Init before use.
func (*GitRemote) Status ¶
func (g *GitRemote) Status() (*SyncStatus, error)
type PullResult ¶
type PullResult struct {
Files []ChangedFile
UpToDate bool // true when no remote changes were found
}
PullResult contains the outcome of a pull operation.
type PushResult ¶
type PushResult struct {
Files []ChangedFile
}
PushResult contains the outcome of a push operation.
type Remote ¶
type Remote interface {
// Init initializes the remote with the given configuration.
// For git, this clones or opens the repository at Config.StoreDir.
Init(config Config) error
// Push uploads local store changes to the remote.
Push(message string) (*PushResult, error)
// Pull downloads remote changes to the local store.
// If force is true, local changes are overwritten.
Pull(force bool) (*PullResult, error)
// Status returns the current sync state between local and remote.
Status() (*SyncStatus, error)
// Type returns the remote type identifier (e.g. "git").
Type() string
}
Remote abstracts storage backends for syncing the hako store. Implementations handle the transport layer (git, cloud APIs, etc.) while the sync engine handles file operations and conflict resolution.
type SyncStatus ¶
SyncStatus reports pending changes on both sides.