Skip to content

Commit d422223

Browse files
Merge pull request #12 from goark/migrate-repos
Migrated repository to github.com/goark/openbd-api
2 parents 846cd1a + b48d9b1 commit d422223

15 files changed

+52
-664
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-go@v2
1414
with:
15-
go-version: ^1.17
15+
go-version: ^1.18
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v2
17+
uses: golangci/golangci-lint-action@v3
1818
with:
1919
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
2020
version: latest

.github/workflows/vulns.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-go@v2
1414
with:
15-
go-version: ^1.17
15+
go-version: ^1.18
1616
- name: install depm
17-
run: go install github.com/spiegel-im-spiegel/depm@latest
17+
run: go install github.com/goark/depm@latest
1818
- name: WriteGoList
1919
run: depm list --json > go.list
2020
- name: Nancy

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# openbd-api -- APIs for openBD by Golang
1+
# [openbd-api] -- APIs for openBD by Golang
22

3-
[![check vulns](https://github.com/spiegel-im-spiegel/openbd-api/workflows/vulns/badge.svg)](https://github.com/spiegel-im-spiegel/openbd-api/actions)
4-
[![lint status](https://github.com/spiegel-im-spiegel/openbd-api/workflows/lint/badge.svg)](https://github.com/spiegel-im-spiegel/openbd-api/actions)
5-
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/openbd-api/master/LICENSE)
6-
[![GitHub release](https://img.shields.io/github/release/spiegel-im-spiegel/openbd-api.svg)](https://github.com/spiegel-im-spiegel/openbd-api/releases/latest)
3+
[![check vulns](https://github.com/goark/openbd-api/workflows/vulns/badge.svg)](https://github.com/goark/openbd-api/actions)
4+
[![lint status](https://github.com/goark/openbd-api/workflows/lint/badge.svg)](https://github.com/goark/openbd-api/actions)
5+
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/goark/openbd-api/master/LICENSE)
6+
[![GitHub release](https://img.shields.io/github/release/goark/openbd-api.svg)](https://github.com/goark/openbd-api/releases/latest)
77

88
This package is required Go 1.16 or later.
99

10+
**Migrated repository to [github.com/goark/openbd-api][openbd-api]**
11+
1012
## Usage of package
1113

1214
### Import Package
1315

1416
```
15-
import "github.com/spiegel-im-spiegel/openbd-api"
17+
import "github.com/goark/openbd-api"
1618
```
1719

1820
### Lookup openBD Book Data
@@ -204,7 +206,7 @@ type Summary struct {
204206
### Download and Build
205207

206208
```
207-
$ go get github.com/spiegel-im-spiegel/openbd-api/cli/openbd
209+
$ go get github.com/goark/openbd-api/cli/openbd
208210
```
209211

210212
### Lookup openBD Books Data
@@ -213,4 +215,4 @@ $ go get github.com/spiegel-im-spiegel/openbd-api/cli/openbd
213215
$ openbd lookup 9784797369915 9784274069321
214216
```
215217

216-
[openbd-api]: https://github.com/spiegel-im-spiegel/openbd-api "spiegel-im-spiegel/openbd-api: APIs for openBD by Golang"
218+
[openbd-api]: https://github.com/goark/openbd-api "goark/openbd-api: APIs for openBD by Golang"

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ tasks:
1111
cmds:
1212
- go mod verify
1313
- go test -shuffle on ./...
14-
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.42.1 golangci-lint run --enable gosec --timeout 3m0s ./...
14+
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.45.0 golangci-lint run --enable gosec --timeout 3m0s ./...
1515
sources:
1616
- ./go.mod
1717
- '**/*.go'
1818

1919
clean:
2020
desc: Initialize module and build cache, and remake go.sum file.
2121
cmds:
22-
- go mod tidy -v -go=1.17
22+
- go mod tidy -v -go=1.18

cli/openbd/facade/facade.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"os/signal"
88
"runtime"
99

10+
"github.com/goark/errs"
11+
"github.com/goark/gocli/exitcode"
12+
"github.com/goark/gocli/rwi"
13+
"github.com/goark/openbd-api/cli/openbd/ecode"
1014
"github.com/spf13/cobra"
11-
"github.com/spiegel-im-spiegel/errs"
12-
"github.com/spiegel-im-spiegel/gocli/exitcode"
13-
"github.com/spiegel-im-spiegel/gocli/rwi"
14-
"github.com/spiegel-im-spiegel/openbd-api/cli/openbd/ecode"
1515
)
1616

1717
var (

cli/openbd/facade/lookup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package facade
33
import (
44
"os"
55

6+
"github.com/goark/errs"
7+
"github.com/goark/gocli/rwi"
8+
"github.com/goark/openbd-api"
69
"github.com/spf13/cobra"
7-
"github.com/spiegel-im-spiegel/errs"
8-
"github.com/spiegel-im-spiegel/gocli/rwi"
9-
"github.com/spiegel-im-spiegel/openbd-api"
1010
)
1111

1212
//newLookupBookCmd returns cobra.Command instance for show sub-command

cli/openbd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"os"
55

6-
"github.com/spiegel-im-spiegel/gocli/rwi"
7-
"github.com/spiegel-im-spiegel/openbd-api/cli/openbd/facade"
6+
"github.com/goark/gocli/rwi"
7+
"github.com/goark/openbd-api/cli/openbd/facade"
88
)
99

1010
//go:generate go-assets-builder -p report -s="/report/assets" -o report/assets.go report/assets/

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"net/url"
77
"strings"
88

9-
"github.com/spiegel-im-spiegel/errs"
10-
"github.com/spiegel-im-spiegel/fetch"
9+
"github.com/goark/errs"
10+
"github.com/goark/fetch"
1111
)
1212

1313
const (

entity-book.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/json"
66
"time"
77

8-
"github.com/spiegel-im-spiegel/errs"
8+
"github.com/goark/errs"
99
)
1010

1111
//Book is entity class of book info.

error.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
package openbd
22

3-
import "fmt"
3+
import "errors"
44

5-
//Error is error codes for books-data
6-
type Error int
7-
8-
const (
9-
ErrNullPointer Error = iota + 1
10-
ErrHTTPStatus
11-
ErrNoData
5+
var (
6+
ErrNullPointer = errors.New("Null reference instance")
7+
ErrHTTPStatus = errors.New("Bad HTTP status")
8+
ErrNoData = errors.New("No response data")
129
)
1310

14-
var errMessages = map[Error]string{
15-
ErrNullPointer: "Null reference instance",
16-
ErrHTTPStatus: "Bad HTTP status",
17-
ErrNoData: "No response data",
18-
}
19-
20-
func (e Error) Error() string {
21-
if s, ok := errMessages[e]; ok {
22-
return s
23-
}
24-
return fmt.Sprintf("unknown error (%d)", int(e))
25-
}
26-
27-
/* Copyright 2019 Spiegel
11+
/* Copyright 2019-2022 Spiegel
2812
*
2913
* Licensed under the Apache License, Version 2.0 (the "License");
3014
* you may not use this file except in compliance with the License.

error_test.go

Lines changed: 0 additions & 42 deletions
This file was deleted.

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
module github.com/spiegel-im-spiegel/openbd-api
1+
module github.com/goark/openbd-api
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/spf13/cobra v1.2.1
7-
github.com/spiegel-im-spiegel/errs v1.0.5
8-
github.com/spiegel-im-spiegel/fetch v0.2.5
9-
github.com/spiegel-im-spiegel/gocli v0.10.5
6+
github.com/goark/errs v1.1.0
7+
github.com/goark/fetch v0.3.0
8+
github.com/goark/gocli v0.12.0
9+
github.com/spf13/cobra v1.4.0
1010
)
1111

1212
require (

0 commit comments

Comments
 (0)