dupver

package
v0.5.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CHUNK_ID_LEN int = 64
View Source
const HexChars = "0123456789abcdef"
View Source
const PACK_ID_LEN int = 64
View Source
const SNAPSHOT_ID_LEN int = 40
View Source
const TREE_ID_LEN int = 40

Variables

This section is empty.

Functions

func CalculateVerbosity

func CalculateVerbosity(verbose bool, quiet bool) int

func Check

func Check(e error)

func CreateFolder

func CreateFolder(folderName string, verbosity int)

func CreateRandomTarFile

func CreateRandomTarFile(workDirFolder string, repoPath string) string

func CreateSubFolder

func CreateSubFolder(parentFolder string, subFolder string, verbosity int)

func FolderToWorkDirName

func FolderToWorkDirName(folder string) string

func GetFullSnapshotId

func GetFullSnapshotId(snapshotId string, cfg workDirConfig) string

func GetHome

func GetHome() string

func GetRevIndex

func GetRevIndex(revision int, numCommits int) int

func InitRepo

func InitRepo(repoPath string, verbosity int)

func InitWorkDir

func InitWorkDir(workDirFolder string, workDirName string, repoPath string, verbosity int)

func ListSnapshots

func ListSnapshots(cfg workDirConfig) []string

func PackFile

func PackFile(filePath string, repoPath string, mypoly chunker.Pol, verbosity int) ([]string, map[string]string)

func PrintAllSnapshots

func PrintAllSnapshots(cfg workDirConfig, snapshot string, opts Options)

func PrintSnapshot

func PrintSnapshot(mySnapshot Commit, maxFiles int, opts Options)

func PrintSnapshots

func PrintSnapshots(cfg workDirConfig, snapshotId string, maxSnapshots int, opts Options)

func RandHexString

func RandHexString(length int) string

func RandString

func RandString(length int, charset string) string

func ReadPacks

func ReadPacks(tarFile *os.File, repoPath string, chunkIds []string, chunkPacks map[string]string, verbosity int)

func ReadRepoConfigFile

func ReadRepoConfigFile(filePath string) repoConfig

func ReadTrees

func ReadTrees(repoPath string) map[string]string

func ReadWorkDirConfig

func ReadWorkDirConfig(workDir string) workDirConfig

func ReadWorkDirConfigFile

func ReadWorkDirConfigFile(filePath string) workDirConfig

func SaveRepoConfig

func SaveRepoConfig(repoPath string, myConfig repoConfig, verbosity int)

func SaveWorkDirConfig

func SaveWorkDirConfig(configPath string, myConfig workDirConfig)

func TimeToPath

func TimeToPath(timeStr string) string

func UnpackFile

func UnpackFile(filePath string, repoPath string, chunkIds []string, verbosity int)

func UpdateRepoPath

func UpdateRepoPath(myWorkDirConfig workDirConfig, repoPath string) workDirConfig

func UpdateWorkDirName

func UpdateWorkDirName(myWorkDirConfig workDirConfig, workDirName string) workDirConfig

func WorkDirStatus

func WorkDirStatus(workDir string, snapshot Commit, verbosity int)

func WriteBranch

func WriteBranch(branchPath string, myBranch Branch, verbosity int)

func WriteHead

func WriteHead(headPath string, myHead Head, verbosity int)

func WritePacks

func WritePacks(f *os.File, repoPath string, poly chunker.Pol, verbosity int) ([]string, map[string]string)

func WritePacks(f *os.File, repoPath string, poly int) map[string]string {

func WriteRandomTar

func WriteRandomTar(buf *os.File, workDirFolder string, repoPath string)

func WriteRandomTarFile

func WriteRandomTarFile(fileName string, workDirFolder string, repoPath string)

func WriteRandomText

func WriteRandomText(f *os.File, numLines int, numCols int, charset string)

func WriteSnapshot

func WriteSnapshot(snapshotPath string, mySnapshot Commit)

func WriteTree

func WriteTree(treePath string, chunkPacks map[string]string)

Types

type Branch

type Branch struct {
	CommitID string
}

func ReadBranch

func ReadBranch(branchPath string) Branch

type Commit

type Commit struct {
	// TarFileName string
	ID        string
	Message   string
	Time      string
	ParentIDs []string
	Files     []fileInfo
	ChunkIDs  []string
}

func ReadSnapshot

func ReadSnapshot(snapshot string, cfg workDirConfig) Commit

func ReadSnapshotFile

func ReadSnapshotFile(snapshotPath string) Commit

func ReadSnapshotId

func ReadSnapshotId(snapshotId string, cfg workDirConfig) (Commit, error)

func UpdateMessage

func UpdateMessage(mySnapshot Commit, msg string, filePath string) Commit
type Head struct {
	BranchName string
	CommitID   string // use this for detached head, but do I need this?
}

func CommitFile

func CommitFile(filePath string, parentIds []string, msg string, verbosity int) Head

func ReadHead

func ReadHead(headPath string) Head

func ReadTarFileIndex

func ReadTarFileIndex(filePath string, verbosity int) ([]fileInfo, workDirConfig, Head)

func ReadTarIndex

func ReadTarIndex(tarFile *os.File, verbosity int) ([]fileInfo, workDirConfig, Head)

type Options

type Options struct {
	Verbosity int
	Color     bool
}

func SetVerbosity

func SetVerbosity(opts Options, verbose bool, quiet bool) Options

Jump to

Keyboard shortcuts

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