file

package
v0.0.0-...-e1fd52c Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 LoadDotFileFromDisk(basePath, dotFilePath string) (*DotFile, error)

func NewDotFile

func NewDotFile(path, mnemonic string, hasHistory bool) (*DotFile, error)

func (*DotFile) AddCommit

func (file *DotFile) AddCommit() (bool, error)

func (*DotFile) HasHistory

func (file *DotFile) HasHistory() bool

func (*DotFile) InitHistory

func (file *DotFile) InitHistory()

func (*DotFile) MetadataToJSON

func (file *DotFile) MetadataToJSON() []byte

func (*DotFile) Mnemonic

func (file *DotFile) Mnemonic() string

func (*DotFile) Path

func (file *DotFile) Path() string

func (*DotFile) RelativePath

func (file *DotFile) RelativePath() string

func (*DotFile) RelativePathHash

func (file *DotFile) RelativePathHash() string

func (*DotFile) RemoveHistory

func (file *DotFile) RemoveHistory()

func (*DotFile) SaveToDisk

func (file *DotFile) SaveToDisk(basePath string) error

func (*DotFile) UpdateContent

func (file *DotFile) UpdateContent() (bool, error)

type HistoryNode

type HistoryNode struct {
	// contains filtered or unexported fields
}

func FromJSON

func FromJSON(data []byte, content string) (*HistoryNode, error)

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

type Sha

type Sha = [sha1.Size]byte

Jump to

Keyboard shortcuts

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