Documentation ¶
Index ¶
- Constants
- Variables
- type Fhd
- func (me *Fhd) Close() error
- func (me *Fhd) Compact() error
- func (me *Fhd) Delete(sid SID, filename string) error
- func (me *Fhd) Dump() error
- func (me *Fhd) DumpTo(writer io.Writer) error
- func (me *Fhd) Extract(filename string, writer io.Writer) error
- func (me *Fhd) ExtractFile(filename string) (string, error)
- func (me *Fhd) ExtractFileForSid(sid SID, filename string) (string, error)
- func (me *Fhd) ExtractForSid(sid SID, filename string, writer io.Writer) error
- func (me *Fhd) FileFormat() (int, error)
- func (me *Fhd) Filename() string
- func (me *Fhd) Ignore(filenames ...string) error
- func (me *Fhd) Ignored() ([]string, error)
- func (me *Fhd) Monitor(filenames ...string) (SaveResult, error)
- func (me *Fhd) MonitorWithComment(comment string, filenames ...string) (SaveResult, error)
- func (me *Fhd) Monitored() ([]*StateItem, error)
- func (me *Fhd) Purge(filename string) error
- func (me *Fhd) Rename(oldFilename, newFilename string) (SaveResult, error)
- func (me *Fhd) Save(comment string) (SaveResult, error)
- func (me *Fhd) SaveCount() int
- func (me *Fhd) SaveCountForSid(sid SID) int
- func (me *Fhd) SaveInfoItemForSid(sid SID) SaveInfoItem
- func (me *Fhd) Sid() SID
- func (me *Fhd) Sids() ([]SID, error)
- func (me *Fhd) SidsForFilename(filename string) ([]SID, error)
- func (me *Fhd) StateForFilename(filename string) (StateVal, error)
- func (me *Fhd) States() ([]*StateItem, error)
- func (me *Fhd) String() string
- func (me *Fhd) Unignore(filenames ...string) error
- func (me *Fhd) Unmonitor(filenames ...string) error
- func (me *Fhd) Unmonitored() ([]*StateItem, error)
- type SID
- type SaveInfoItem
- type SaveInfoVal
- type SaveResult
- type StateItem
- type StateVal
Constants ¶
const (
InvalidSID = 0
)
Variables ¶
var ( //go:embed Version.dat Version string )
Functions ¶
This section is empty.
Types ¶
type Fhd ¶
type Fhd struct {
// contains filtered or unexported fields
}
func (*Fhd) Delete ¶
Delete deletes the given file for the given save. If this is the only occurrence of the file, adds the filename to the ignored list.
func (*Fhd) DumpTo ¶
DumpTo writes data from the underlying database to the writer purely for debugging and testing.
func (*Fhd) Extract ¶
Writes the content of the given filename from the most recently saved change to the given writer.
func (*Fhd) ExtractFile ¶
Writes the content of the given filename from the most recently saved change to a new filename, filename#SID.ext, and returns the new filename.
func (*Fhd) ExtractFileForSid ¶
Writes the content of the given filename from the specified Save (identified by its SID) to new filename, filename#SID.ext, and returns the new filename.
func (*Fhd) ExtractForSid ¶
Writes the content of the given filename from the specified Save (identified by its SID) to the given writer.
func (*Fhd) FileFormat ¶
Format returns the underlying database's file format number.
func (*Fhd) Monitor ¶
func (me *Fhd) Monitor(filenames ...string) (SaveResult, error)
Monitor adds the given files to be monitored _and_ does a Save. Returns the new Save ID (SID) and sets of missing and ignored files (which aren't monitored).
func (*Fhd) MonitorWithComment ¶
func (me *Fhd) MonitorWithComment(comment string, filenames ...string) (SaveResult, error)
MonitorWithComment adds the given files to be monitored _and_ does an initial Save with the given comment. Returns the new Save ID (SID) and sets of missing and ignored files (which aren't monitored).
func (*Fhd) Purge ¶
Purges deletes every save of the given file and adds the filename to the ignored list.
func (*Fhd) Rename ¶
func (me *Fhd) Rename(oldFilename, newFilename string) (SaveResult, error)
Rename oldFilename to newFilename. This is merely a convenience for fhd.Unmonitor(oldFilename) followed by fhd.Monitor(newFilename).
func (*Fhd) Save ¶
func (me *Fhd) Save(comment string) (SaveResult, error)
Save saves a snapshot of every monitored file that's changed and returns the corresponding SaveResult with the new save ID (SID) and sets of any missing and ignored files (which have now become unmonitored—or ignored).
func (*Fhd) SaveCountForSid ¶
SaveCountForSid returns the number of saved files in the specified save.
func (*Fhd) SaveInfoItemForSid ¶
func (me *Fhd) SaveInfoItemForSid(sid SID) SaveInfoItem
SaveInfoItemForSid returns the SaveInfoItem for the given SID or an invalid SaveInfoItem on error.
func (*Fhd) SidsForFilename ¶
Returns all the SIDs for the given filename from most- to least-recent.
func (*Fhd) StateForFilename ¶
Returns the most recent StateVal for the given filename.
func (*Fhd) States ¶
States returns the monitoring state of every monitored and unmonitored file and the SID of the last save it was saved into.
func (*Fhd) Unignore ¶
Unignore deletes the given filenames or globs from the ignored list. But it never deletes "*.fhd".
func (*Fhd) Unmonitor ¶
Unmonitor sets the state of every given file to unmonitored if it is being monitored and preserves its SID. For any file that isn't already monitored, adds it to the ignored list.
func (*Fhd) Unmonitored ¶
Unmonitored returns the list of every unmonitored file. These are files that have been monitored in the past but have been set to be unmonitored.
type SaveInfoItem ¶
type SaveInfoItem struct { Sid SID SaveInfoVal }
func (*SaveInfoItem) IsValid ¶
func (me *SaveInfoItem) IsValid() bool
func (*SaveInfoItem) String ¶
func (me *SaveInfoItem) String() string