Skip to content

Commit

Permalink
prepare v1.0.0 (close #127)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimus committed Aug 24, 2022
1 parent d11c204 commit bdae467
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

## [v1.0.0] 2022-08-24 Wed

- Add [#127]: prepare v1.0.0.
- Add: Nix build and shell files.
- Add: rename dictionaries.

Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ connection.
* [Usage of API](#usage-of-api)
* [Projects based on GNfinder](#projects-based-on-gnfinder)
* [Development](#development)
* [Modify OpenAPI documentation](#modify-openapi-documentation)
* [Testing](#testing)

<!-- vim-markdown-toc -->
Expand Down Expand Up @@ -359,13 +358,13 @@ If you want to start your own API endpoint (for example on `localhost`, port
```bash
gnfinder -p 8080
curl localhost:8080/api/v0/ping
curl localhost:8080/api/v1/ping
```
To upload a file and detect names from its content:
```bash
curl -v -F verification=true -F file=@/path/to/test.txt https://gnfinder.globalnames.org/api/v0/find
curl -v -F verification=true -F file=@/path/to/test.txt https://gnfinder.globalnames.org/api/v1/find
```
## Projects based on GNfinder
Expand All @@ -390,12 +389,6 @@ make tools
make install
```
### Modify OpenAPI documentation
```bash
docker run -d -p 80:8080 swaggerapi/swagger-editor
```
## Testing
From the root of the project:
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Config struct {
// DataSources is a list of data-source IDs used for the
// name-verification. These data-sources will always be matched with the
// verified names. You can find the list of all data-sources at
// https://verifier.globalnames.org/api/v0/data_sources
// https://verifier.globalnames.org/api/v1/data_sources
DataSources []int

// TikaURL contains the URL of Apache Tika service. This service is used
Expand Down Expand Up @@ -257,9 +257,9 @@ func New(opts ...Option) Config {
WithBayes: true,
BayesOddsThreshold: 80.0,
TokensAround: 0,
VerifierURL: "https://verifier.globalnames.org/api/v0/",
VerifierURL: "https://verifier.globalnames.org/api/v1/",
TikaURL: "https://tika.globalnames.org",
APIDoc: "https://apidoc.globalnames.org/gnfinder-beta",
APIDoc: "https://apidoc.globalnames.org/gnfinder",
}

for _, opt := range opts {
Expand Down
2 changes: 1 addition & 1 deletion gnfinder/cmd/gnfinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# VerifierURL contains the URL of a name-verification service.
#
# VerifierURL: https://verifier.globalnames.org/api/v0/
# VerifierURL: https://verifier.globalnames.org/api/v1/

# WithAllMatches sets verification to return all found matches.
#
Expand Down
8 changes: 4 additions & 4 deletions io/web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func Run(gnf gnfinder.GNfinder, port int) {
e.POST("/find", find(gnf))

e.GET("/api", infoAPI(gnf))
e.GET("/api/v0", infoAPI(gnf))
e.GET("/api/v0/ping", pingAPI())
e.GET("/api/v0/version", verAPI(gnf))
e.POST("/api/v0/find", findAPI(gnf))
e.GET("/api/v1", infoAPI(gnf))
e.GET("/api/v1/ping", pingAPI())
e.GET("/api/v1/version", verAPI(gnf))
e.POST("/api/v1/find", findAPI(gnf))

fs := http.FileServer(http.FS(static))
e.GET("/static/*", echo.WrapHandler(fs))
Expand Down
8 changes: 4 additions & 4 deletions io/web/templates/apidoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ <h2>Application Programming Interface (API)</h2>
<div id='content-body'>

<p>
Web-based scientific names finding service provides a RESTful
Web-based scientific names finding service provides a RESTful
API interface.
</p>

<h3 id="post">Using POST Method with JSON payload</h3>

<pre class='code'>/api/v0</code></pre>
<pre class='code'>/api/v1</code></pre>

<p>
with request body in JSON according to the
Expand All @@ -32,14 +32,14 @@ <h3 id="post">Using POST Method to Upload Files</h3>
against
<a href='https://verifier.globalnames.org/data_sources/1'>
Catalogue of Life
</a> (source #1) and
</a> (source #1) and
<a href='https://verifier.globalnames.org/data_sources/12'>
Encyclopedia of Life
</a> (source #12):
</p>

<pre class='code'>curl -v -F sources[]=1 -F sources[]=12 -F file=@file.pdf \
https://finder.globalnames.org/api/v0/find</pre>
https://finder.globalnames.org/api/v1/find</pre>

<p>
For examples how to write a client, refer to
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gnfinder

var (
Version = "v0.19.5+"
Version = "v1.0.0+"
Build string
)

0 comments on commit bdae467

Please sign in to comment.