32 lines
521 B
Go
32 lines
521 B
Go
package registry
|
|
|
|
import (
|
|
"git.maximhutz.com/max/lambda/pkg/engine"
|
|
)
|
|
|
|
type Process interface {
|
|
engine.Process[Repr]
|
|
|
|
InType() string
|
|
}
|
|
|
|
type convertedProcess[T any] struct {
|
|
process engine.Process[T]
|
|
inType string
|
|
}
|
|
|
|
func (e convertedProcess[T]) InType() string { return e.inType }
|
|
|
|
func (b convertedProcess[T]) Get() (Repr, error) {
|
|
s, err := b.process.Get()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return NewRepr(b.inType, s), nil
|
|
}
|
|
|
|
func (b convertedProcess[T]) Step(i int) bool {
|
|
return b.process.Step(i)
|
|
}
|