Documentation
¶
Index ¶
- Variables
- type DotFile
- func (file *DotFile) AddCommit() (bool, error)
- func (file *DotFile) HasHistory() bool
- func (file *DotFile) InitHistory()
- func (file *DotFile) MetadataToJSON() []byte
- func (file *DotFile) Mnemonic() string
- func (file *DotFile) Path() string
- func (file *DotFile) RelativePath() string
- func (file *DotFile) RelativePathHash() string
- func (file *DotFile) RemoveHistory()
- func (file *DotFile) SaveToDisk(basePath string) error
- func (file *DotFile) UpdateContent() (bool, error)
- type HistoryNode
- type Sha
Constants ¶
This section is empty.
Variables ¶
View Source
var Afs = fs.OsAfs
View Source
var BasePathNotFound = errors.New("base path directory not found")
View Source
var Fs = fs.OsFs
Functions ¶
This section is empty.
Types ¶
type DotFile ¶
type DotFile struct {
// contains filtered or unexported fields
}
func LoadDotFileFromDisk ¶
func (*DotFile) HasHistory ¶
func (*DotFile) InitHistory ¶
func (file *DotFile) InitHistory()
func (*DotFile) MetadataToJSON ¶
func (*DotFile) RelativePath ¶
func (*DotFile) RelativePathHash ¶
func (*DotFile) RemoveHistory ¶
func (file *DotFile) RemoveHistory()
func (*DotFile) SaveToDisk ¶
func (*DotFile) UpdateContent ¶
type HistoryNode ¶
type HistoryNode struct {
// contains filtered or unexported fields
}
func NewHistory ¶
func NewHistory(contents string, timestamp time.Time) *HistoryNode
NewHistory creates a new history tree and returns the root node.
func (*HistoryNode) AddCommit ¶
func (history *HistoryNode) AddCommit(contents string, timestamp time.Time) *HistoryNode
AddCommit adds a commit if necessary and returns the created node or nil if nothing was created.
func (*HistoryNode) Content ¶
func (history *HistoryNode) Content() string
Content returns the content corresponding to this node
func (*HistoryNode) NodeWithUUID ¶
func (node *HistoryNode) NodeWithUUID(uuid string) *HistoryNode
func (*HistoryNode) ToJSON ¶
func (node *HistoryNode) ToJSON() []byte
Click to show internal directories.
Click to hide internal directories.