elasticstream/source/interface.go

23 lines
387 B
Go
Raw Normal View History

2024-10-07 16:26:41 +05:30
package source
2024-10-07 15:25:13 +05:30
import (
"context"
2024-10-07 16:26:41 +05:30
"elasticstream/config"
"elasticstream/opencdc"
2024-10-07 15:25:13 +05:30
)
type Position struct {
ID string
Index string
Pos int
}
type Source interface {
2024-10-07 16:26:41 +05:30
Configure(context.Context, config.Config) error
2024-10-07 15:25:13 +05:30
Open(context.Context, []Position) error
2024-10-07 16:26:41 +05:30
Read(context.Context) (*opencdc.Data, error)
2024-10-07 15:25:13 +05:30
Ack(context.Context, Position) error
Teardown(context.Context) error
}