Documentation
¶
Index ¶
Constants ¶
View Source
const ( // spool is immutable, consumed tasks remains in spool. Immutable = iota // spool is mutable, consumed tasks are removed Mutable )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem interface {
fs.FS
Create(path string, attr *struct{}) (File, error)
Remove(path string) error
}
A FileSystem provides access to a hierarchical file system. The abstraction support I/O to local file system or AWS S3. Use it with https://github.com/fogfish/stream
type Spool ¶
type Spool struct {
// contains filtered or unexported fields
}
func New ¶
func New(reader, writer FileSystem, mode int) *Spool
func (*Spool) ForEach ¶
func (spool *Spool) ForEach( ctx context.Context, dir string, f func(context.Context, string, io.Reader) (io.ReadCloser, error), ) error
Apply the spool function over each file in the reader filesystem, producing results to writer file system.
func (*Spool) ForEachFile ¶
func (spool *Spool) ForEachFile( ctx context.Context, dir string, f func(context.Context, string, []byte) ([]byte, error), ) error
Apply the spool function over each file in the reader filesystem, producing results to writer file system. It is a variant of [ForEach] that used bytes slices.
Click to show internal directories.
Click to hide internal directories.