Documentation
¶
Overview ¶
don't do go generate ./... //go:generate stringer -type=ObjectType
Index ¶
- Variables
- func DumpGitObject(r io.Reader, w io.Writer)
- type Blob
- type Commit
- type GitObject
- type GitObjectInfo
- type Object
- type ObjectKind
- type Queue
- type Tag
- type Tree
- func (t *Tree) Append(entry *TreeEntry)
- func (t *Tree) Content() string
- func (t *Tree) EntryCount() int
- func (t *Tree) Find(name string) *TreeEntry
- func (t *Tree) ForEach(fn WalkTreeEntryFunc)
- func (t *Tree) Hash() common.Hash
- func (t *Tree) Id() common.Hash
- func (t *Tree) Kind() ObjectKind
- func (t *Tree) RegularizeEntries()
- func (t *Tree) Sort()
- func (t *Tree) Subtree(name string) *TreeEntry
- func (t *Tree) ToGitObject() *GitObject
- func (t *Tree) ZeroId()
- type TreeEntry
- type TreeEntryCollection
- type TreeFs
- func (fs *TreeFs) DFWalk(fn WalkWithPathFunc, preordering bool)
- func (fs *TreeFs) DFWalkWithPrefix(prefix string, fn WalkWithPathFunc, preordering bool)
- func (c *TreeFs) Debug()
- func (fs *TreeFs) Find(path string) *Tree
- func (fs *TreeFs) InitWithRoot(r *Tree)
- func (fs *TreeFs) MakeTreeAll(path string) *Tree
- func (fs *TreeFs) Merge(anothor *TreeFs)
- func (fs *TreeFs) Root() *Tree
- func (fs *TreeFs) WalkByPath(path string, fn WalkFunc, preordering bool)
- type TreePair
- type WalkFunc
- type WalkTreeEntryFunc
- type WalkWithPathFunc
Constants ¶
This section is empty.
Variables ¶
var ( ErrGitObjectDataCorruptted = errors.New("Git object data corruptted.") ErrInvalidObject = errors.New("Invalidate Object.") )
Functions ¶
Types ¶
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
Blob object, implements Interface TreeEntry{ Object, fs.DirEntry}
func GitObjectToBlob ¶
func (*Blob) FromGitObject ¶
func (*Blob) Kind ¶
func (b *Blob) Kind() ObjectKind
type Commit ¶
type Commit struct { TreePair // contains filtered or unexported fields }
func EmptyCommit ¶
func EmptyCommit() *Commit
func GitObjectToCommit ¶
GitObject ==> Tree,fitll Tree using GotObject from repository
func (*Commit) Kind ¶
func (c *Commit) Kind() ObjectKind
func (*Commit) ToGitObject ¶
type GitObject ¶
type GitObject struct {
// contains filtered or unexported fields
}
GitObject, unmodifiable object
func NewGitObject ¶
func NewGitObject(t ObjectKind, content []byte) *GitObject
func (*GitObject) Kind ¶
func (g *GitObject) Kind() ObjectKind
type GitObjectInfo ¶
type GitObjectInfo struct { }
func (*GitObjectInfo) IsDir ¶
func (g *GitObjectInfo) IsDir() bool
func (*GitObjectInfo) ModTime ¶
func (g *GitObjectInfo) ModTime() time.Time
func (*GitObjectInfo) Mode ¶
func (g *GitObjectInfo) Mode() fs.FileMode
func (*GitObjectInfo) Name ¶
func (g *GitObjectInfo) Name() string
func (*GitObjectInfo) Size ¶
func (g *GitObjectInfo) Size() int64
func (*GitObjectInfo) Sys ¶
func (g *GitObjectInfo) Sys() any
type ObjectKind ¶
type ObjectKind byte
const ( Kind_Blob ObjectKind = iota Kind_Tree Kind_Commit Kind_Tag Kind_Unknow )
func ObjectKindFromFilemode ¶
func ObjectKindFromFilemode(fm common.FileMode) ObjectKind
func ParseObjectKind ¶
func ParseObjectKind(kind string) ObjectKind
func (ObjectKind) String ¶
func (t ObjectKind) String() string
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
func (*Tag) FromGitObject ¶
func (*Tag) ToGitObject ¶
func (*Tag) Type ¶
func (c *Tag) Type() ObjectKind
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree implements Object interface
func GitObjectToTree ¶
GitObject ==> Tree,fitll Tree using GotObject from repository
func (*Tree) EntryCount ¶
func (*Tree) ForEach ¶
func (t *Tree) ForEach(fn WalkTreeEntryFunc)
func (*Tree) Kind ¶
func (t *Tree) Kind() ObjectKind
func (*Tree) RegularizeEntries ¶
func (t *Tree) RegularizeEntries()
Update, remove extra empty subtrees and update tree entries which are async with subtree Caution: empty tree entries will be remove and
func (*Tree) ToGitObject ¶
type TreeEntry ¶
type TreeEntry struct { Oid common.Hash Kind ObjectKind Name string Filemode common.FileMode // Pointer to Subtree(*Tree) or Blob(*Blob) identified by oid and implement common Object interface Pointer Object }
100644 blob ec1871edcbfdc0d17ef498030e7ca676f291393d LICENSE // Blob and Tree Object both implemente TreeEntry interface
type TreeEntryCollection ¶
type TreeEntryCollection []*TreeEntry
type TreeFs ¶
type TreeFs struct {
// contains filtered or unexported fields
}
mapping from fullpath to Tree object
func EmptyTreeFs ¶
func EmptyTreeFs() *TreeFs
func (*TreeFs) DFWalk ¶
func (fs *TreeFs) DFWalk(fn WalkWithPathFunc, preordering bool)
Depth-first Walk, travel all trees
func (*TreeFs) DFWalkWithPrefix ¶
func (fs *TreeFs) DFWalkWithPrefix(prefix string, fn WalkWithPathFunc, preordering bool)
func (*TreeFs) InitWithRoot ¶
func (*TreeFs) MakeTreeAll ¶
MakeTreeAll creates a tree named path, along with any necessary parents, and returns nil, or else returns an error. Return the tree if it has alright existed, do nothing else.