Documentation ¶
Overview ¶
Package zip provide convenience utilities to work with config files.
Index ¶
Constants ¶
View Source
const (
DefaultFileMode = 0o644
)
Variables ¶
View Source
var ErrFlushed = errors.New("zipped file: already flushed")
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.