elasticstream/source/interface.go

23 lines
430 B
Go

package source
import (
"context"
"elasticstream/config"
"elasticstream/opencdc"
)
type Position struct {
ID string `json:"id"`
Index string `json:"index"`
Pos int `json:"pos"`
}
type Source interface {
Configure(context.Context, config.Config) error
Open(context.Context, []Position) error
Read(context.Context) (*opencdc.Data, error)
Ack(context.Context, Position) error
Teardown(context.Context) error
}