start parsing each layer

This commit is contained in:
Will Murphy 2018-05-20 10:41:36 -04:00
parent 2ab60618ff
commit f91fb4c6eb

View File

@ -3,6 +3,7 @@ package main
import (
"archive/tar"
"bytes"
"crypto/md5"
"encoding/json"
"fmt"
"io"
@ -68,6 +69,7 @@ func main() {
}
func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
hasher := md5.New
size := h.Size
tarredBytes := make([]byte, size)
_, err := parentReader.Read(tarredBytes)
@ -92,6 +94,7 @@ func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
switch header.Typeflag {
case tar.TypeDir:
fmt.Println(" Directory: ", name)
continue
case tar.TypeReg:
fmt.Println(" File: ", name)
@ -110,6 +113,15 @@ func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
}
}
func makeEntry(r *tar.Reader, h *tar.Header) {
}
type FileChangeInfo struct {
typeflag int
md5sum [16]byte
}
type Manifest struct {
Config string
RepoTags []string