Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDuplicateTracking(filePath string) (bool, bool)
- func GetGlobalOopsDir() (string, error)
- type GlobalStoreInfo
- type Snapshot
- type Store
- func (s *Store) Back(num int, force bool) error
- func (s *Store) Changes(versions ...int) (string, error)
- func (s *Store) Delete() error
- func (s *Store) Exists() bool
- func (s *Store) GetLatestVersion() (int, error)
- func (s *Store) History() ([]Snapshot, error)
- func (s *Store) Initialize() error
- func (s *Store) Now() (current int, latest int, hasChanges bool, err error)
- func (s *Store) OopsDirPath() string
- func (s *Store) Save(message string) (*Snapshot, error)
- func (s *Store) ShouldCompress() bool
- func (s *Store) Undo() error
- type StoreOptions
Constants ¶
const ( OopsDir = ".oops" GlobalOopsDir = ".oops" // stored in user home directory )
Variables ¶
Functions ¶
func CheckDuplicateTracking ¶ added in v0.3.0
CheckDuplicateTracking checks if file is tracked in both local and global Returns (hasLocal, hasGlobal)
func GetGlobalOopsDir ¶ added in v0.3.0
GetGlobalOopsDir returns the global .oops directory path
Types ¶
type GlobalStoreInfo ¶ added in v0.3.0
GlobalStoreInfo represents info about a globally tracked file
func ListGlobalStores ¶ added in v0.3.0
func ListGlobalStores() ([]GlobalStoreInfo, error)
ListGlobalStores returns all globally tracked files
type Store ¶
type Store struct {
FilePath string
FileName string
BaseDir string
GitDir string
Repo *git.Repo
Global bool // true if using global storage
}
Store manages versioning for a single file using Git backend
func FindGlobalStore ¶ added in v0.3.0
FindGlobalStore finds an existing global store for a file path
func NewGlobalStore ¶ added in v0.3.0
NewGlobalStore creates a store instance for a file (global mode)
func NewStoreWithOptions ¶ added in v0.3.0
func NewStoreWithOptions(filePath string, opts StoreOptions) (*Store, error)
NewStoreWithOptions creates a store instance with specified options
func (*Store) GetLatestVersion ¶
GetLatestVersion returns the latest version number
func (*Store) Initialize ¶
Initialize creates a new store for tracking (start/track)
func (*Store) OopsDirPath ¶
OopsDirPath returns the path to .oops directory
func (*Store) ShouldCompress ¶
ShouldCompress checks if the tracked file should be compressed
type StoreOptions ¶ added in v0.3.0
type StoreOptions struct {
Global bool // Use global storage in user home directory
}
StoreOptions configures Store behavior