MCPcopy Index your code
hub / github.com/linuxkit/linuxkit / writeLayoutBlob

Function writeLayoutBlob

src/cmd/linuxkit/cache/layout.go:104–117  ·  view source on GitHub ↗
(tw *tar.Writer, digest string, size int64, blob io.Reader)

Source from the content-addressed store, hash-verified

102}
103
104func writeLayoutBlob(tw *tar.Writer, digest string, size int64, blob io.Reader) error {
105 if err := tw.WriteHeader(&tar.Header{
106 Name: fmt.Sprintf("blobs/sha256/%s", digest),
107 Mode: 0644,
108 Size: size,
109 Typeflag: tar.TypeReg,
110 }); err != nil {
111 return err
112 }
113 if _, err := io.Copy(tw, blob); err != nil {
114 return err
115 }
116 return nil
117}
118
119func writeLayoutIndex(tw *tar.Writer, desc v1.Descriptor) error {
120 ii := empty.Index

Callers 2

OCITarReaderMethod · 0.85
writeLayoutImageFunction · 0.85

Calls 1

WriteHeaderMethod · 0.45

Tested by

no test coverage detected