Documentation ¶
Index ¶
- Constants
- Variables
- func DirOfFilePath(path string) string
- func FileModeToString(m FileMode) string
- func IsDir(m FileMode) bool
- func IsFile(m FileMode) bool
- func IsRegular(m FileMode) bool
- func StatTimes(fi os.FileInfo) (atime, mtime, ctime time.Time)
- func ValidateFilePath(path string) string
- type Change
- type Changes
- type FileInfo
- type FileMode
- type Hash
- type NameHashPair
- type NameHashPairs
Constants ¶
View Source
const ( NUL byte = 0x00 SPACE byte = 0x20 DELIM byte = 0x0a )
Variables ¶
View Source
var (
ErrMalformatedString = errors.New("malformed hexadecimal hash represented string")
)
Functions ¶
func DirOfFilePath ¶
func FileModeToString ¶
func ValidateFilePath ¶
Types ¶
type Change ¶
type Change struct { From *NameHashPair To *NameHashPair }
type Changes ¶
func CompareOrderedNameHashPairs ¶
func CompareOrderedNameHashPairs(pairA NameHashPairs, pairB NameHashPairs) *Changes
The tow arguments must be sorted by NameHashPair.Name
type FileMode ¶
func NewFileMode ¶
New takes the octal string representation of a FileMode and returns the FileMode and a nil error. If the string can not be parsed to a 32 bit unsigned octal number, it returns Empty and the parsing error.
Example: "40000" means Dir, "100644" means Regular.
type Hash ¶
type Hash [20]byte
Git Object Id represented with 20 bytes
var InvalidObjectId Hash
var (
ZeroHash Hash
)
func HashObject ¶
hash contetn by append gitobject header (kind, size)
type NameHashPair ¶
type NameHashPairs ¶
type NameHashPairs []*NameHashPair
Click to show internal directories.
Click to hide internal directories.