start parsing each layer
This commit is contained in:
parent
2ab60618ff
commit
f91fb4c6eb
12
tar-read.go
12
tar-read.go
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"archive/tar"
|
"archive/tar"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/md5"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -68,6 +69,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
|
func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
|
||||||
|
hasher := md5.New
|
||||||
size := h.Size
|
size := h.Size
|
||||||
tarredBytes := make([]byte, size)
|
tarredBytes := make([]byte, size)
|
||||||
_, err := parentReader.Read(tarredBytes)
|
_, err := parentReader.Read(tarredBytes)
|
||||||
@ -92,6 +94,7 @@ func printFilesInTar(parentReader *tar.Reader, h *tar.Header) {
|
|||||||
|
|
||||||
switch header.Typeflag {
|
switch header.Typeflag {
|
||||||
case tar.TypeDir:
|
case tar.TypeDir:
|
||||||
|
fmt.Println(" Directory: ", name)
|
||||||
continue
|
continue
|
||||||
case tar.TypeReg:
|
case tar.TypeReg:
|
||||||
fmt.Println(" File: ", name)
|
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 {
|
type Manifest struct {
|
||||||
Config string
|
Config string
|
||||||
RepoTags []string
|
RepoTags []string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user