This function generates a metadata object for sgzip.GzipMetadata or SzstdMetadata. Warning: This function panics if cmeta is not of the expected type.
(size int64, mode int, cmeta any, md5 string, mimeType string)
| 175 | // This function generates a metadata object for sgzip.GzipMetadata or SzstdMetadata. |
| 176 | // Warning: This function panics if cmeta is not of the expected type. |
| 177 | func (z *zstdModeHandler) newMetadata(size int64, mode int, cmeta any, md5 string, mimeType string) *ObjectMetadata { |
| 178 | meta, ok := cmeta.(SzstdMetadata) |
| 179 | if !ok { |
| 180 | panic("invalid cmeta type: expected SzstdMetadata") |
| 181 | } |
| 182 | |
| 183 | objMeta := new(ObjectMetadata) |
| 184 | objMeta.Size = size |
| 185 | objMeta.Mode = mode |
| 186 | objMeta.CompressionMetadataGzip = nil |
| 187 | objMeta.CompressionMetadataZstd = &meta |
| 188 | objMeta.MD5 = md5 |
| 189 | objMeta.MimeType = mimeType |
| 190 | |
| 191 | return objMeta |
| 192 | } |
no outgoing calls
no test coverage detected