-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
32 lines (27 loc) · 1.09 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Package verifier provides data about biodiversity
// data-sources and metadata about scientific names aggregated from them.
// The package includes an interface for the data access.
package verifier
import (
"context"
mlib "github.com/gnames/gnlib/ent/matcher"
vlib "github.com/gnames/gnlib/ent/verifier"
)
// Verifier is an interface that can be implemented by any data provider
// able to prepare raw data for verification.
type Verifier interface {
// DataSources returns a slice of all data-sources known to gnames. If
// idd are provided, it returns a slice of requested data-sources.
DataSources(ids ...int) ([]*vlib.DataSource, error)
// MatchRecords function returns unsorted records corresponding to Input
// matches. Matches contain an input name-string, and strings that matched
// that input.
MatchRecords(
ctx context.Context,
matches []mlib.Match,
input vlib.Input,
) (map[string]*MatchRecord, error)
// NameByID takes a name-string UUID with options and returns back
// matched results or an error in case of a failure.
NameByID(vlib.NameStringInput) (*MatchRecord, error)
}