mirror of
https://github.com/nxshock/mssqlbulkloader.git
synced 2024-11-27 00:11:02 +05:00
26 lines
351 B
Go
26 lines
351 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/klauspost/compress/zstd"
|
||
|
)
|
||
|
|
||
|
type ZstdReader struct{}
|
||
|
|
||
|
func (zr *ZstdReader) Process(options *Options) error {
|
||
|
f, err := os.Open(options.filePath)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
defer f.Close()
|
||
|
|
||
|
r, err := zstd.NewReader(f)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
defer r.Close()
|
||
|
|
||
|
return process(f, options)
|
||
|
}
|