From b1a9413a5002f1fc3980e19f230ed56834929301 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 03:45:29 +0000 Subject: [PATCH 1/6] Bump github.com/gofiber/fiber/v2 from 2.52.2 to 2.52.4 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.52.2 to 2.52.4. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.52.2...v2.52.4) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a0be355..639c943 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module lab.sda1.net/nexryai/summaly-go go 1.21.5 require ( - github.com/gofiber/fiber/v2 v2.52.2 + github.com/gofiber/fiber/v2 v2.52.4 github.com/nexryai/summergo v0.1.3 github.com/nexryai/visualog v0.0.1 ) diff --git a/go.sum b/go.sum index a3581a2..72f499a 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/gofiber/fiber/v2 v2.52.2 h1:b0rYH6b06Df+4NyrbdptQL8ifuxw/Tf2DgfkZkDaxEo= -github.com/gofiber/fiber/v2 v2.52.2/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= +github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= From bbe7c4664fe14b7d628b37a576453bd19f59426c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 03:18:17 +0000 Subject: [PATCH 2/6] Bump github.com/nexryai/summergo from 0.1.3 to 0.1.4 Bumps [github.com/nexryai/summergo](https://github.com/nexryai/summergo) from 0.1.3 to 0.1.4. - [Commits](https://github.com/nexryai/summergo/compare/v0.1.3...v0.1.4) --- updated-dependencies: - dependency-name: github.com/nexryai/summergo dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 639c943..8c9d8a3 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.5 require ( github.com/gofiber/fiber/v2 v2.52.4 - github.com/nexryai/summergo v0.1.3 + github.com/nexryai/summergo v0.1.4 github.com/nexryai/visualog v0.0.1 ) @@ -23,7 +23,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/go.sum b/go.sum index 72f499a..8c42fa5 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/nexryai/archer v0.0.1 h1:vKtJzt7j+enma8CH7QZsmd1tUZ3tK5ZOkXZ3glDrJGc= github.com/nexryai/archer v0.0.1/go.mod h1:cjBXUP/oxPpm8JMiZW5GPpzC6s+ZmaVPxTxrxw+zxJM= -github.com/nexryai/summergo v0.1.3 h1:JSkyxUsYC03sFKalH6WPsSIvYMgSEN8KqSSd93YB1DU= -github.com/nexryai/summergo v0.1.3/go.mod h1:LNI030RU+ZkwSG3Mj/rvdDJ8u2IE7Sc0owUTLsE+0Jo= +github.com/nexryai/summergo v0.1.4 h1:aRfkcsa5wMoMa68FXJ0iehgDDqKVbz2qibrxMUyplZ8= +github.com/nexryai/summergo v0.1.4/go.mod h1:qKG6ChQqk9AI0RuftKzI5iMGRWBTLz4Rxvz45xdBDns= github.com/nexryai/visualog v0.0.1 h1:TV+PFzRHUDS6NTtL0Jb39bVQxqDSgPHNciWA0m+CAvE= github.com/nexryai/visualog v0.0.1/go.mod h1:ODcYfc6Wk0cWFPP1Vjv5u+9RQLOToH5MeQKRP+MdfPA= github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= @@ -42,8 +42,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -55,8 +55,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= From b09be769432922df8126003ee58837a2ed585246 Mon Sep 17 00:00:00 2001 From: nexryai <61890205+nexryai@users.noreply.github.com> Date: Mon, 15 Apr 2024 06:19:41 +0000 Subject: [PATCH 3/6] Improve error message --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 1807774..4ce9d90 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func main() { err := app.Listen(":3000") if err != nil { - log.FatalWithDetail("err:", err) + log.FatalWithDetail("Failed to listen on :3000:", err) os.Exit(1) } } From 367802f5ef5591e441b2a7d0f5d4017e2be7521a Mon Sep 17 00:00:00 2001 From: nexryai <61890205+nexryai@users.noreply.github.com> Date: Mon, 15 Apr 2024 06:21:28 +0000 Subject: [PATCH 4/6] Fix error message --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 4ce9d90..df3bcab 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func main() { err := app.Listen(":3000") if err != nil { - log.FatalWithDetail("Failed to listen on :3000:", err) + log.FatalWithDetail("Failed to listen on :3000 >>> ", err) os.Exit(1) } } From 37eeff704f75f92f4367333222c10f1e66276b98 Mon Sep 17 00:00:00 2001 From: nexryai <61890205+nexryai@users.noreply.github.com> Date: Mon, 15 Apr 2024 06:23:41 +0000 Subject: [PATCH 5/6] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7412f97..8734a2c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## summaly-go -Misskey(とその派生)で使えるsummaly-proxy +Misskey(とその派生)で使えるGoで書かれた軽量なsummaly-proxy 中身は[別ライブラリ(summergo)として](https://github.com/nexryai/summergo)公開しています From f95a752afa77506c147ba56a793a4228b1970ca9 Mon Sep 17 00:00:00 2001 From: nexryai <61890205+nexryai@users.noreply.github.com> Date: Mon, 15 Apr 2024 06:27:39 +0000 Subject: [PATCH 6/6] Refactor --- internal/router/summaly.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/router/summaly.go b/internal/router/summaly.go index 1e42d00..bc72d91 100644 --- a/internal/router/summaly.go +++ b/internal/router/summaly.go @@ -31,9 +31,7 @@ func SummalyRouter(app *fiber.App) { log.ErrorWithDetail("Error on Summarize():", err) ctx.Status(400) return ctx.SendString("Invalid URL") - } - - if summaly == nil { + } else if summaly == nil { log.Error("Result is nil. returning 500") ctx.Status(500) return ctx.SendString("Internal Server Error")