/
interface.go
30 lines (24 loc) · 1.05 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
package gnames
import (
"context"
"github.com/gnames/gnlib/ent/gnvers"
"github.com/gnames/gnlib/ent/verifier"
"github.com/gnames/gnquery/ent/search"
)
// GNames is the main use-case interface of the app. Its purpose to provide
// metadata of registered DataSources and provide functionality for
// verification (resolution/reconciliation) of name-strings to
// known to gnames scientific names, as well as providing data where
// these names occur.
type GNames interface {
// GetVersion returns the version of GNames and a timestamp of its build.
GetVersion() gnvers.Version
// Verify takes a slice of name-strings together with query parameters and
// returns back results of verification.
Verify(ctx context.Context, params verifier.Input) (verifier.Output, error)
// Search takes
Search(ctx context.Context, srch search.Input) search.Output
// Datasources take IDs of data-sourses and return back list of corresponding
// metadata. If no IDs are given, it returns metadata for all data-sources.
DataSources(ids ...int) ([]*verifier.DataSource, error)
}