repo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigEnv = "CLAWDEX_CONFIG"
	RepoEnv          = "CLAWDEX_REPO"
	DefaultRemote    = "https://github.com/steipete/backup-clawdex.git"
)

Variables

This section is empty.

Functions

func ResolveConfigPath

func ResolveConfigPath(flagPath string) string

func ResolveRepoPath

func ResolveRepoPath(flagRepo string, cfg Config) (string, error)

func WriteConfig

func WriteConfig(path string, cfg Config) error

Types

type Apple

type Apple struct {
	Enabled bool `toml:"enabled" json:"enabled"`
}

type Config

type Config struct {
	Version  int       `toml:"version" json:"version"`
	RepoPath string    `toml:"repo_path" json:"repo_path"`
	Git      GitConfig `toml:"git" json:"git"`
	Repair   Repair    `toml:"repair" json:"repair"`
	Google   Google    `toml:"google" json:"google"`
	Apple    Apple     `toml:"apple" json:"apple"`
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig

func LoadConfig(path string) (Config, error)

func (*Config) Normalize

func (c *Config) Normalize()

type GitConfig

type GitConfig struct {
	Remote   string `toml:"remote" json:"remote"`
	Branch   string `toml:"branch" json:"branch"`
	AutoPull bool   `toml:"auto_pull" json:"auto_pull"`
	AutoPush bool   `toml:"auto_push" json:"auto_push"`
}

type Google

type Google struct {
	DefaultAccount string `toml:"default_account" json:"default_account"`
	Adapter        string `toml:"adapter" json:"adapter"`
}

type Repair

type Repair struct {
	AutoRepair         bool `toml:"auto_repair" json:"auto_repair"`
	BackupBeforeRepair bool `toml:"backup_before_repair" json:"backup_before_repair"`
}

type Repo

type Repo struct {
	Path   string
	Config Config
}

func Open

func Open(path string, cfg Config) Repo

func (Repo) Commit

func (r Repo) Commit(ctx context.Context, message string) (bool, error)

func (Repo) Dirty

func (r Repo) Dirty(ctx context.Context) (bool, error)

func (Repo) IndexDir

func (r Repo) IndexDir() string

func (Repo) Init

func (r Repo) Init(ctx context.Context) error

func (Repo) MirrorOptions

func (r Repo) MirrorOptions() mirror.Options

func (Repo) PeopleDir

func (r Repo) PeopleDir() string

func (Repo) Pull

func (r Repo) Pull(ctx context.Context) error

func (Repo) Push

func (r Repo) Push(ctx context.Context) error

func (Repo) RepairDir

func (r Repo) RepairDir() string

func (Repo) Require

func (r Repo) Require() error

Jump to

Keyboard shortcuts

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