API tweaks

This commit is contained in:
Alex Yatskov 2015-12-20 17:47:46 +09:00
parent 2f684bb48d
commit 20cd5d48ed
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ func (s *stage) chain(p Plugin) {
fin, _ := p.(Finalizer)
if init != nil {
if err := init.Initialize(); err != nil {
if err := init.Initialize(s); err != nil {
s.gs.fault(nil, err)
return
}
@ -63,7 +63,7 @@ func (s *stage) chain(p Plugin) {
go func() {
defer wg.Done()
for f := range s.input {
if proc == nil || accept != nil && !accept.Accept(f) {
if proc == nil || accept != nil && !accept.Accept(s, f) {
s.output <- f
} else {
f.rewind()

View File

@ -87,11 +87,11 @@ func (e *Error) Error() string {
}
type Initializer interface {
Initialize() error
Initialize(ctx Context) error
}
type Accepter interface {
Accept(file File) bool
Accept(ctx Context, file File) bool
}
type Finalizer interface {