diff --git a/cmd/example/main.go b/cmd/example/main.go index 676ce96..e72fbf9 100644 --- a/cmd/example/main.go +++ b/cmd/example/main.go @@ -9,7 +9,7 @@ import ( "github.com/aaronland/go-sqlite/tables" "github.com/whosonfirst/go-whosonfirst-iterate/v2/emitter" "github.com/whosonfirst/go-whosonfirst-log" - "github.com/whosonfirst/go-whosonfirst-sqlite-index" + "github.com/whosonfirst/go-whosonfirst-sqlite-index/v2" "io" "os" "strings" @@ -71,7 +71,7 @@ func main() { to_index = append(to_index, ex) - record_func := func(ctx context.Context, fh io.ReadSeeker, args ...interface{}) (interface{}, error) { + record_func := func(ctx context.Context, path string, fh io.ReadSeeker, args ...interface{}) (interface{}, error) { now := time.Now() diff --git a/go.mod b/go.mod index 99b59dd..4da211f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/whosonfirst/go-whosonfirst-sqlite-index +module github.com/whosonfirst/go-whosonfirst-sqlite-index/v2 go 1.16 diff --git a/index.go b/index.go index cd80f31..9aa8916 100644 --- a/index.go +++ b/index.go @@ -14,7 +14,7 @@ import ( type SQLiteIndexerPostIndexFunc func(context.Context, sqlite.Database, []sqlite.Table, interface{}) error -type SQLiteIndexerLoadRecordFunc func(context.Context, io.ReadSeeker, ...interface{}) (interface{}, error) +type SQLiteIndexerLoadRecordFunc func(context.Context, string, io.ReadSeeker, ...interface{}) (interface{}, error) type SQLiteIndexer struct { callback emitter.EmitterCallbackFunc @@ -44,7 +44,7 @@ func NewSQLiteIndexer(opts *SQLiteIndexerOptions) (*SQLiteIndexer, error) { emitter_cb := func(ctx context.Context, path string, fh io.ReadSeeker, args ...interface{}) error { - record, err := record_func(ctx, fh, args...) + record, err := record_func(ctx, path, fh, args...) if err != nil { logger.Warning("failed to load record (%s) because %s", path, err)