Documentation ¶
Overview ¶
Package file provides convenient helpers for files and abstractions of files
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockZipReader ¶
func ZipBasePath ¶
Types ¶
type File ¶
type File struct { Content io.ReadCloser Path string Size int64 // If the content type is not explicitly specified, ContenType will be an empty string. ContentType string }
File abstracts an abstract file
type FilteredIterator ¶
type FilteredIterator struct {
// contains filtered or unexported fields
}
func NewFilteredIterator ¶
func NewFilteredIterator(a Iterator, skipper func(p string) bool) *FilteredIterator
func (*FilteredIterator) Next ¶
func (s *FilteredIterator) Next() (*File, error)
type FsIterator ¶
type FsIterator struct {
// contains filtered or unexported fields
}
func NewFsIterator ¶
func NewFsIterator(afs afero.Fs) (*FsIterator, error)
func (*FsIterator) Next ¶
func (a *FsIterator) Next() (*File, error)
type Iterator ¶
type Iterator interface { // Next returns the next File. If there is no next File, returns nil file and nil error Next() (*File, error) }
Iterator is an iterator of files
type PrefixIterator ¶
type PrefixIterator struct {
// contains filtered or unexported fields
}
func NewPrefixIterator ¶
func NewPrefixIterator(a Iterator, prefix string) *PrefixIterator
func (*PrefixIterator) Next ¶
func (s *PrefixIterator) Next() (*File, error)
type SimpleIterator ¶
type SimpleIterator struct {
// contains filtered or unexported fields
}
For debugging
func NewSimpleIterator ¶
func NewSimpleIterator(files []File) *SimpleIterator
func (*SimpleIterator) Next ¶
func (s *SimpleIterator) Next() (*File, error)
type TarReader ¶
type TarReader struct {
// contains filtered or unexported fields
}
func NewTarReader ¶
Click to show internal directories.
Click to hide internal directories.