core

package
v0.0.0-...-74eadf2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) error

func KVLMParse

func KVLMParse(data []byte) string

func KVLMSerialize

func KVLMSerialize(data string) string

func ObjectWrite

func ObjectWrite(obj GitObject, repo *GitRepo)

func RepoDefaultConfig

func RepoDefaultConfig(path string)

func RepoDir

func RepoDir(gitrepo *GitRepo, mkdir bool, path ...string) (string, error)

func RepoFile

func RepoFile(gitrepo *GitRepo, mkdir bool, path ...string) string

func RepoPath

func RepoPath(gitrepo *GitRepo, path ...string) string

func TreeParse

func TreeParse(data []byte) []string

func TreeSerialize

func TreeSerialize(data []string) string

func WriteToRepoFile

func WriteToRepoFile(filepath string, content string)

Types

type BaseGitObject

type BaseGitObject struct {
	ObjType string
}

func (*BaseGitObject) Deserialize

func (b *BaseGitObject) Deserialize(data []byte)

func (*BaseGitObject) Init

func (b *BaseGitObject) Init()

func (*BaseGitObject) Serialize

func (b *BaseGitObject) Serialize() string

type GitBlob

type GitBlob struct {
	BaseGitObject
	BlobData []byte
}

func NewGitBlob

func NewGitBlob(data []byte) *GitBlob

func (*GitBlob) Deserialize

func (b *GitBlob) Deserialize(data []byte)

func (*GitBlob) Serialize

func (b *GitBlob) Serialize() string

type GitCommit

type GitCommit struct {
	BaseGitObject
	Kvlm string
}

func NewGitCommit

func NewGitCommit(data []byte, objType string) *GitCommit

func (*GitCommit) Deserialize

func (c *GitCommit) Deserialize(data []byte)

func (*GitCommit) Serialize

func (c *GitCommit) Serialize() string

type GitObject

type GitObject interface {
	Serialize() string
	Deserialize(data []byte)
	Init()
}

func NewGitObject

func NewGitObject(objType string, data []byte) (GitObject, error)

func ObjectRead

func ObjectRead(repo *GitRepo, sha string) (GitObject, error)

type GitRepo

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

func NewEmptyGitRepo

func NewEmptyGitRepo() *GitRepo

func RepoCreate

func RepoCreate(path string) *GitRepo

func (*GitRepo) Gitdir

func (g *GitRepo) Gitdir() string

func (*GitRepo) SetupRepo

func (g *GitRepo) SetupRepo(path string, force bool)

func (*GitRepo) Worktree

func (g *GitRepo) Worktree() string

type GitTree

type GitTree struct {
	BaseGitObject
	Items []string
}

func NewGitTree

func NewGitTree(data []byte) *GitTree

func (*GitTree) Deserialize

func (t *GitTree) Deserialize(data []byte)

func (*GitTree) Serialize

func (t *GitTree) Serialize() string

Jump to

Keyboard shortcuts

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