types.go 459 B

123456789101112131415161718192021222324252627282930313233
  1. package xstream
  2. import (
  3. "context"
  4. )
  5. type Emitter interface {
  6. AddOutput(chan<- interface{}, string)
  7. }
  8. type Source interface {
  9. Emitter
  10. Open(context context.Context) error
  11. }
  12. type Collector interface {
  13. GetInput() (chan<- interface{}, string)
  14. }
  15. type Sink interface {
  16. Collector
  17. Open(context context.Context) <-chan error
  18. }
  19. type Operator interface{
  20. Emitter
  21. Collector
  22. Exec(context context.Context) error
  23. }
  24. type TopNode interface{
  25. GetName() string
  26. }