Documentation
¶
Overview ¶
gnquery package is a parser of a search query for GNames API. The query is used for faceted search that can be filtered by abbreviated name, by species epithet, author, year, a parent clade.
Example ¶
package main
import (
"fmt"
"github.com/gnames/gnquery"
)
func main() {
q := "ds:2 tx:Aves g:Bubo asp:bubo y:1758"
gnq := gnquery.New()
res := gnq.Parse(q)
fmt.Println(res.Query)
fmt.Println(res.DataSources)
fmt.Println(res.ParentTaxon)
fmt.Println(res.Genus)
fmt.Println(res.SpeciesAny)
fmt.Println(res.Year)
fmt.Println(res.Tail)
}
Output: ds:2 tx:Aves g:Bubo asp:bubo y:1758 [2] Aves Bubo bubo 1758
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GNquery ¶
type GNquery interface {
// Parse takes a query and returns back an Input object for performing
// a faceted search in GNames.
Parse(q string) search.Input
// Process takes an search.Input, updates its fields if necessary
// (for example if there is a query or name fields) and returns
// this updated input.
Process(inp search.Input) search.Input
}
GNquery is an object for parsing search queries by GNames.
Click to show internal directories.
Click to hide internal directories.