Skip to content

Commit

Permalink
Merge pull request #10 from spiegel-im-spiegel/fix-bugs
Browse files Browse the repository at this point in the history
Add fetch package (breaking change)
  • Loading branch information
spiegel-im-spiegel authored Mar 7, 2021
2 parents dbbd23c + 0eeb95b commit 0407c93
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 124 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/vulns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: ^1.16
- name: install depm
run: go install github.com/spiegel-im-spiegel/depm@latest
- name: WriteGoList
run: go list -json -m all > go.list
run: depm list --json > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@main
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ This package is required Go 1.16 or later.

### Import Package

```
```go
import "github.com/spiegel-im-spiegel/aozora-api"
```

### Search for Aozora-bunko Books Data

```
```go
books, err := aozora.DefaultClient().SearchBooks(
aozora.WithBookTitle("/天に積む宝/"),
aozora.WithBookAuthor("富田倫生"),
Expand All @@ -26,41 +26,41 @@ books, err := aozora.DefaultClient().SearchBooks(

### Lookup Aozora-bunko Book Data

```
```go
book, err := aozora.DefaultClient().LookupBook(59489)
```

### Search for Aozora-bunko Persons Data

```
```go
persons, err := aozora.DefaultClient().SearchPersons(
aozora.WithPersonName("富田倫生"),
)
```

### Lookup Aozora-bunko Person Data

```
```go
person, err := aozora.DefaultClient().LookupPerson(55)
```

### Search for Aozora-bunko Workers Data

```
```go
workers, err := aozora.DefaultClient().SearchWorkers(
aozora.WithWorkerName("雪森"),
)
```

### Lookup Aozora-bunko Worker Data

```
```go
worker, err := aozora.DefaultClient().LookupWorker(845)
```

### Lookup Ranking data of Aozora-bunko

```
```go
tm, err := time.Parse("2006-01", "2019-01")
ranking, err := aozora.DefaultClient().Ranking(tm)
```
Expand All @@ -69,7 +69,7 @@ ranking, err := aozora.DefaultClient().Ranking(tm)

### Book type

```
```go
//Author is entity class of author and translator info.
type Author struct {
PersonID int `json:"person_id"`
Expand Down Expand Up @@ -128,7 +128,7 @@ type Book struct {

### Person type

```
```go
//Person is entity class of person info.
type Person struct {
PersonID int `json:"person_id"`
Expand All @@ -148,7 +148,7 @@ type Person struct {

### Worker type

```
```go
//Worker is entity class of worker info.
type Worker struct {
WorkerID int `json:"id"`
Expand All @@ -158,7 +158,7 @@ type Worker struct {

### Ranking type

```
```go
//Ranking is entity class of ranking info.
type Ranking []struct {
BookID int `json:"book_id"`
Expand Down
Loading

0 comments on commit 0407c93

Please sign in to comment.