Skip to content

Commit f91fb4c

Browse files
start parsing each layer
1 parent 2ab6061 commit f91fb4c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tar-read.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"archive/tar"
55
"bytes"
6+
"crypto/md5"
67
"encoding/json"
78
"fmt"
89
"io"
@@ -68,6 +69,7 @@ func main() {
6869
}
6970

7071
func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
72+
hasher := md5.New
7173
size := h.Size
7274
tarredBytes := make([]byte, size)
7375
_, err := parentReader.Read(tarredBytes)
@@ -92,6 +94,7 @@ func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
9294

9395
switch header.Typeflag {
9496
case tar.TypeDir:
97+
fmt.Println(" Directory: ", name)
9598
continue
9699
case tar.TypeReg:
97100
fmt.Println(" File: ", name)
@@ -110,6 +113,15 @@ func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
110113
}
111114
}
112115

116+
func makeEntry(r *tar.Reader, h *tar.Header) {
117+
118+
}
119+
120+
type FileChangeInfo struct {
121+
typeflag int
122+
md5sum [16]byte
123+
}
124+
113125
type Manifest struct {
114126
Config string
115127
RepoTags []string

0 commit comments

Comments
 (0)