-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.go
More file actions
34 lines (29 loc) · 709 Bytes
/
objects.go
File metadata and controls
34 lines (29 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
//"encoding/json"
"time"
)
type Blob struct {
Blob_ID string //sha1 hash key of this blob
Content string
}
type TreeNode struct {//i'll define a trie data structure.
Name string
Children map[string]*TreeNode //mapping between directories' and files' names and their node struct.
Is_blob bool
}
type Tree struct {
root *TreeNode
}
type User struct {
Username string `json:"user_name"`
Useremail string `json:"email_address"`
EventDate time.Time `json:"event_date"`
}
type Commit struct {
Commit_ID string //sha1 hash key of this commit
Author *User
parent_tree string //points to parent tree's id
parents []string //slice of to parents commits' ids
message string
}