Documentation
¶
Overview ¶
Package zip provide convenience utilities to work with config files.
Index ¶
Constants ¶
const (
DefaultFileMode = 0o644
)
Variables ¶
var ErrFlushed = errors.New("zipped file: already flushed")
Functions ¶
func UnPackWithDirCheck ¶ added in v2.46.7
Types ¶
type FileReaderCallback ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(p *proto.ZippedFile) (*Reader, error)
NewReader returns a Reader to help with extracting the files from the provided ZippedFile proto.
func NewReaderFromPayloads ¶
NewReaderFromPayloads returns a Reader to help with extracting the provided zipped content
func (*Reader) RangeFileReaders ¶
func (r *Reader) RangeFileReaders(callback FileReaderCallback)
RangeFileReaders calls f sequentially for each file in the zip archive. If f returns false, range stops the iteration.
type Writer ¶
Writer is a helper for building the proto ZippedFile for sending with multiple file contents. Uses in memory bytes.Buffer, should be extended if larger file content is expected.