MCPcopy Create free account
hub / github.com/bytebase/bytebase / CreateZipWriter

Function CreateZipWriter

backend/component/export/zip.go:38–45  ·  view source on GitHub ↗

CreateZipWriter creates a zip writer for the given writer with a file header.

(zipw *zip.Writer, filename string, password string)

Source from the content-addressed store, hash-verified

36
37// CreateZipWriter creates a zip writer for the given writer with a file header.
38func CreateZipWriter(zipw *zip.Writer, filename string, password string) (io.Writer, error) {
39 fh := CreateZipFileHeader(filename, password)
40 writer, err := zipw.CreateHeader(fh)
41 if err != nil {
42 return nil, errors.Wrapf(err, "failed to create zip entry for %s", filename)
43 }
44 return writer, nil
45}
46
47// timeToMsDosTime converts a time.Time to an MS-DOS date and time.
48// This is a modified copy for github.com/alexmullins/zip/struct.go because the package has a bug,

Callers 2

formatExportToZipMethod · 0.92
formatExportToZipFunction · 0.92

Calls 1

CreateZipFileHeaderFunction · 0.85

Tested by

no test coverage detected