From 1918ca159ad3ff690d5e520a15b7ce1589f820b2 Mon Sep 17 00:00:00 2001 From: voluntas Date: Thu, 11 Jan 2024 16:59:58 +0900 Subject: [PATCH 01/42] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b83ca7..0b145e1 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,8 @@ sequenceDiagram ## ライセンス ``` -Copyright 2022-2023, Hiroshi Yoshida (Original Author) -Copyright 2022-2023, Shiguredo Inc. +Copyright 2022-2024, Hiroshi Yoshida (Original Author) +Copyright 2022-2024, Shiguredo Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From cfdb17cd9ec2036e3890eed723481d38d9f945f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:29:09 +0000 Subject: [PATCH 02/42] fix(deps): update golang.org/x/exp digest to db7319d --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3637915..5d7727d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pion/rtp v1.8.3 github.com/rs/zerolog v1.31.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 golang.org/x/net v0.19.0 golang.org/x/sync v0.6.0 google.golang.org/api v0.155.0 diff --git a/go.sum b/go.sum index 8b7bef4..d2beafd 100644 --- a/go.sum +++ b/go.sum @@ -175,6 +175,8 @@ golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcs golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= From cd72d4cc696935d4b7851e3bee0fb28f8f3bcc6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:09:51 +0000 Subject: [PATCH 03/42] fix(deps): update all non-major dependencies --- go.mod | 22 +++++++++++----------- go.sum | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 5d7727d..3ed308a 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/shiguredo/suzu -go 1.21.5 +go 1.21.6 require ( cloud.google.com/go/speech v1.21.0 - github.com/aws/aws-sdk-go v1.49.16 + github.com/aws/aws-sdk-go v1.49.21 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 @@ -12,9 +12,9 @@ require ( github.com/rs/zerolog v1.31.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 - golang.org/x/net v0.19.0 + golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.155.0 + google.golang.org/api v0.156.0 google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 @@ -22,7 +22,7 @@ require ( ) require ( - cloud.google.com/go v0.110.10 // indirect + cloud.google.com/go v0.111.0 // indirect cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/longrunning v0.5.4 // indirect @@ -57,14 +57,14 @@ require ( go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d2beafd..ba272f1 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= +cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= @@ -18,6 +20,8 @@ github.com/aws/aws-sdk-go v1.49.13 h1:f4mGztsgnx2dR9r8FQYa9YW/RsKb+N7bgef4UGrOW1 github.com/aws/aws-sdk-go v1.49.13/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.49.16 h1:KAQwhLg296hfffRdh+itA9p7Nx/3cXS/qOa3uF9ssig= github.com/aws/aws-sdk-go v1.49.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.21 h1:Rl8KW6HqkwzhATwvXhyr7vD4JFUMi7oXGAw9SrxxIFY= +github.com/aws/aws-sdk-go v1.49.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -166,6 +170,8 @@ golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -192,9 +198,13 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -220,6 +230,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -243,6 +255,8 @@ google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= +google.golang.org/api v0.156.0 h1:yloYcGbBtVYjLKQe4enCunxvwn3s2w/XPrrhVf6MsvQ= +google.golang.org/api v0.156.0/go.mod h1:bUSmn4KFO0Q+69zo9CNIDp4Psi6BqM0np0CbzKRSiSY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -254,14 +268,20 @@ google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 h1:EWIeHfGuUf00zrVZGEgYFxok7plSAXBGcH7NNdMAWvA= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= From d3ad2f1005aa0a2f2e9c508f1173b8c4dd8db762 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 16 Jan 2024 15:44:29 +0900 Subject: [PATCH 04/42] =?UTF-8?q?-=20=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=AB=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=99=E3=82=8B=20-=20draft=20=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03f0849..8889cec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,4 +27,4 @@ jobs: - name: Release run: | - ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace "${GITHUB_REF##*/}" dist/ + ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace "${GITHUB_REF##*/}" -n "${GITHUB_REF##*/}" -draft dist/ From b9ce350595e09a9efae92afe7f00daf6aab7b960 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 17 Jan 2024 11:20:41 +0900 Subject: [PATCH 05/42] =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=93=E3=82=B9?= =?UTF-8?q?=E6=AF=8E=E3=81=AB=20status=20code=20=E3=81=A8=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe.go | 11 +++++++++++ errors.go | 20 ++++++++++++++++++++ handler.go | 9 +++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 errors.go diff --git a/amazon_transcribe.go b/amazon_transcribe.go index 9501238..844a2d5 100644 --- a/amazon_transcribe.go +++ b/amazon_transcribe.go @@ -6,6 +6,7 @@ import ( "net/http" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/transcribestreamingservice" ) @@ -95,6 +96,16 @@ func (at *AmazonTranscribe) Start(ctx context.Context, r io.Reader) (*transcribe resp, err := client.StartStreamTranscriptionWithContext(ctx, &input) if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + code, ok := awsTranscribeErrors[awsErr.Code()] + if !ok { + return nil, err + } + return nil, &SuzuError{ + Code: code, + Message: awsErr.Message(), + } + } return nil, err } diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..6bc27d5 --- /dev/null +++ b/errors.go @@ -0,0 +1,20 @@ +package suzu + +import "github.com/aws/aws-sdk-go/service/transcribestreamingservice" + +type SuzuError struct { + Code int + Message string +} + +func (e *SuzuError) Error() string { + return e.Message +} + +var awsTranscribeErrors = map[string]int{ + transcribestreamingservice.ErrCodeLimitExceededException: 429, + transcribestreamingservice.ErrCodeConflictException: 409, + transcribestreamingservice.ErrCodeBadRequestException: 400, + transcribestreamingservice.ErrCodeInternalFailureException: 500, + transcribestreamingservice.ErrCodeServiceUnavailableException: 503, +} diff --git a/handler.go b/handler.go index 1251641..6ee048c 100644 --- a/handler.go +++ b/handler.go @@ -135,8 +135,13 @@ func (s *Server) createSpeechHandler(serviceType string, onResultFunc func(conte Str("channel_id", h.SoraChannelID). Str("connection_id", h.SoraConnectionID). Send() - // TODO: エラー内容で status code を変更する - return echo.NewHTTPError(http.StatusInternalServerError) + if err, ok := err.(*SuzuError); ok { + // SuzuError の場合はその Status Code を返す + return echo.NewHTTPError(err.Code, err) + } + + // SuzuError 以外の場合は 500 を返す + return echo.NewHTTPError(http.StatusInternalServerError, err) } defer reader.Close() From 70c345af7bc6e3cb77f64b4049cb6e619f1ec751 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 17 Jan 2024 11:25:29 +0900 Subject: [PATCH 06/42] =?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8889cec..0b6d3f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,4 +27,4 @@ jobs: - name: Release run: | - ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace "${GITHUB_REF##*/}" -n "${GITHUB_REF##*/}" -draft dist/ + ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace -n "${GITHUB_REF##*/}" -draft "${GITHUB_REF##*/}" dist/ From 2d5e330381433960cc9614c9e13aa8441e535f62 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 17 Jan 2024 12:58:21 +0900 Subject: [PATCH 07/42] =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=93=E3=82=B9?= =?UTF-8?q?=E6=AF=8E=E3=81=AB=E5=88=86=E3=81=91=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=80=81=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E3=82=92=E7=A7=BB=E5=8B=95=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe.go | 13 ++++++++++++- errors.go | 10 ---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/amazon_transcribe.go b/amazon_transcribe.go index 844a2d5..3a5b010 100644 --- a/amazon_transcribe.go +++ b/amazon_transcribe.go @@ -11,6 +11,17 @@ import ( "github.com/aws/aws-sdk-go/service/transcribestreamingservice" ) +var ( + // https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html#API_streaming_StartStreamTranscription_Errors + amazonTranscribeStreamingServiceErrors = map[string]int{ + transcribestreamingservice.ErrCodeLimitExceededException: 429, + transcribestreamingservice.ErrCodeConflictException: 409, + transcribestreamingservice.ErrCodeBadRequestException: 400, + transcribestreamingservice.ErrCodeInternalFailureException: 500, + transcribestreamingservice.ErrCodeServiceUnavailableException: 503, + } +) + type AmazonTranscribe struct { LanguageCode string MediaEncoding string @@ -97,7 +108,7 @@ func (at *AmazonTranscribe) Start(ctx context.Context, r io.Reader) (*transcribe resp, err := client.StartStreamTranscriptionWithContext(ctx, &input) if err != nil { if awsErr, ok := err.(awserr.Error); ok { - code, ok := awsTranscribeErrors[awsErr.Code()] + code, ok := amazonTranscribeStreamingServiceErrors[awsErr.Code()] if !ok { return nil, err } diff --git a/errors.go b/errors.go index 6bc27d5..34a3551 100644 --- a/errors.go +++ b/errors.go @@ -1,7 +1,5 @@ package suzu -import "github.com/aws/aws-sdk-go/service/transcribestreamingservice" - type SuzuError struct { Code int Message string @@ -10,11 +8,3 @@ type SuzuError struct { func (e *SuzuError) Error() string { return e.Message } - -var awsTranscribeErrors = map[string]int{ - transcribestreamingservice.ErrCodeLimitExceededException: 429, - transcribestreamingservice.ErrCodeConflictException: 409, - transcribestreamingservice.ErrCodeBadRequestException: 400, - transcribestreamingservice.ErrCodeInternalFailureException: 500, - transcribestreamingservice.ErrCodeServiceUnavailableException: 503, -} From 78c2f95ae16ec035f9cf612a0d112dd5216f572e Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 17 Jan 2024 17:01:13 +0900 Subject: [PATCH 08/42] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E6=99=82?= =?UTF-8?q?=E3=81=AB=20JSON=20=E3=82=92=E8=BF=94=E3=81=99=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 23 ++++++++++++++++++----- handler.go | 9 ++++++++- speech_to_text_handler.go | 14 +++++++++----- test_handler.go | 34 +++++++++++++++++++++++++++------- 4 files changed, 62 insertions(+), 18 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 2a0201e..3052d75 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -43,11 +43,10 @@ type AwsResult struct { TranscriptionResult } -func NewAwsResult(err error) AwsResult { +func NewAwsResult() AwsResult { return AwsResult{ TranscriptionResult: TranscriptionResult{ - Type: "aws", - Error: err, + Type: "aws", }, } } @@ -62,6 +61,11 @@ func (ar *AwsResult) WithIsPartial(isPartial bool) *AwsResult { return ar } +func (ar *AwsResult) SetMessage(message string) *AwsResult { + ar.Message = message + return ar +} + func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeReader, error) { at := NewAmazonTranscribe(h.Config, h.LanguageCode, int64(h.SampleRate), int64(h.ChannelCount)) @@ -111,7 +115,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) } } - result := NewAwsResult(nil) + result := NewAwsResult() if at.Config.AwsResultIsPartial { result.WithIsPartial(*res.IsPartial) } @@ -123,7 +127,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) if alt.Transcript != nil { message = *alt.Transcript } - result.Message = message + result.SetMessage(message) if err := encoder.Encode(result); err != nil { w.CloseWithError(err) return @@ -138,6 +142,15 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) } if err := stream.Err(); err != nil { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + // 復帰が不可能なエラー以外は再接続を試みる switch err.(type) { case *transcribestreamingservice.LimitExceededException, diff --git a/handler.go b/handler.go index 6ee048c..cd53e92 100644 --- a/handler.go +++ b/handler.go @@ -26,10 +26,17 @@ var ( type TranscriptionResult struct { Message string `json:"message,omitempty"` - Error error `json:"error,omitempty"` + Reason string `json:"reason,omitempty"` Type string `json:"type"` } +func NewSuzuErrorResponse(message string) TranscriptionResult { + return TranscriptionResult{ + Type: "error", + Reason: message, + } +} + func getServiceHandler(serviceType string, config Config, channelID, connectionID string, sampleRate uint32, channelCount uint16, languageCode string, onResultFunc any) (serviceHandlerInterface, error) { newHandlerFunc, err := NewServiceHandlerFuncs.get(serviceType) if err != nil { diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 0f28878..4e3fbcd 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -45,11 +45,10 @@ type GcpResult struct { TranscriptionResult } -func NewGcpResult(err error) GcpResult { +func NewGcpResult() GcpResult { return GcpResult{ TranscriptionResult: TranscriptionResult{ - Type: "gcp", - Error: err, + Type: "gcp", }, } } @@ -64,6 +63,11 @@ func (gr *GcpResult) WithStability(stability float32) *GcpResult { return gr } +func (gr *GcpResult) SetMessage(message string) *GcpResult { + gr.Message = message + return gr +} + func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeReader, error) { stt := NewSpeechToText(h.Config, h.LanguageCode, int32(h.SampleRate), int32(h.ChannelCount)) @@ -151,7 +155,7 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io } } - result := NewGcpResult(nil) + result := NewGcpResult() if stt.Config.GcpResultIsFinal { result.WithIsFinal(res.IsFinal) } @@ -173,7 +177,7 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io } } transcript := alternative.Transcript - result.Message = transcript + result.SetMessage(transcript) if err := encoder.Encode(result); err != nil { w.CloseWithError(err) return diff --git a/test_handler.go b/test_handler.go index 0113fcc..fc9ee2f 100644 --- a/test_handler.go +++ b/test_handler.go @@ -3,6 +3,7 @@ package suzu import ( "context" "encoding/json" + "errors" "fmt" "io" ) @@ -40,12 +41,13 @@ type TestResult struct { TranscriptionResult } -func TestErrorResult(err error) TestResult { +func NewTestResult(channelID, message string) TestResult { return TestResult{ TranscriptionResult: TranscriptionResult{ - Type: "test", - Error: err, + Type: "test", + Message: message, }, + ChannelID: &channelID, } } @@ -53,24 +55,42 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea r, w := io.Pipe() go func() { + c := 0 encoder := json.NewEncoder(w) for { + c += 1 buf := make([]byte, FrameSize) n, err := reader.Read(buf) if err != nil { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + // TODO: ログを書く + } w.CloseWithError(err) return } + if c > 10 { + err := errors.New("c > 10") + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + w.CloseWithError(err) + return + } + } + if n > 0 { - var result TestResult - result.Type = "test" - result.Message = fmt.Sprintf("n: %d", n) - result.ChannelID = &[]string{"ch_0"}[0] + message := fmt.Sprintf("n: %d", n) + channelID := &[]string{"ch_0"}[0] + result := NewTestResult(*channelID, message) if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, result); err != nil { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + // TODO: ログを書く + } w.CloseWithError(err) return } From e1c91c146acb348322f0301ab3314e50a49fdd77 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 18 Jan 2024 16:34:34 +0900 Subject: [PATCH 09/42] =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_handler.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test_handler.go b/test_handler.go index fc9ee2f..f7bfc5d 100644 --- a/test_handler.go +++ b/test_handler.go @@ -3,7 +3,6 @@ package suzu import ( "context" "encoding/json" - "errors" "fmt" "io" ) @@ -55,11 +54,9 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea r, w := io.Pipe() go func() { - c := 0 encoder := json.NewEncoder(w) for { - c += 1 buf := make([]byte, FrameSize) n, err := reader.Read(buf) if err != nil { @@ -71,15 +68,6 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea return } - if c > 10 { - err := errors.New("c > 10") - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - w.CloseWithError(err) - return - } - } - if n > 0 { message := fmt.Sprintf("n: %d", n) channelID := &[]string{"ch_0"}[0] From 20bca3649e00eef977b30c7ec091247251b2b24b Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 19 Jan 2024 10:47:21 +0900 Subject: [PATCH 10/42] =?UTF-8?q?=E3=82=B3=E3=82=B9=E3=83=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_handler_test.go b/test_handler_test.go index 43fe17a..5368aec 100644 --- a/test_handler_test.go +++ b/test_handler_test.go @@ -125,7 +125,7 @@ func TestSpeechHandler(t *testing.T) { lastMessage = result.Message } // TODO: テストデータは固定のため、すべてのメッセージを確認する - assert.Equal(t, lastMessage, "n: 3") + assert.Equal(t, "n: 3", lastMessage) } }) From 702bef0cfcec638627b80567aa8310632033be3f Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 19 Jan 2024 10:47:54 +0900 Subject: [PATCH 11/42] =?UTF-8?q?EOF=20=E3=81=AE=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AF=20JSON=20=E3=82=92=E8=BF=94=E3=81=95=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_handler.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test_handler.go b/test_handler.go index f7bfc5d..4b143fe 100644 --- a/test_handler.go +++ b/test_handler.go @@ -60,9 +60,11 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea buf := make([]byte, FrameSize) n, err := reader.Read(buf) if err != nil { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - // TODO: ログを書く + if err != io.EOF { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + // TODO: ログを書く + } } w.CloseWithError(err) return From 8c53f616ae8e2d141b9f80566b6cd7b296b29683 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 19 Jan 2024 14:08:31 +0900 Subject: [PATCH 12/42] =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E3=81=A7=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_handler_test.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/test_handler_test.go b/test_handler_test.go index 5368aec..05a33a0 100644 --- a/test_handler_test.go +++ b/test_handler_test.go @@ -359,4 +359,47 @@ func TestSpeechHandler(t *testing.T) { }) + t.Run("stream error", func(t *testing.T) { + r := readDumpFile(t, "testdata/dump.jsonl", 0) + defer r.Close() + + e := echo.New() + req := httptest.NewRequest("POST", path, r) + req.Header.Set("sora-audio-streaming-language-code", "ja-JP") + req.Proto = "HTTP/2.0" + req.ProtoMajor = 2 + req.ProtoMinor = 0 + rec := httptest.NewRecorder() + c := e.NewContext(req, rec) + + h := s.createSpeechHandler(serviceType, func(ctx context.Context, w io.WriteCloser, chnanelID, connectionID, languageCode string, results any) error { + return fmt.Errorf("STREAM-ERROR") + }) + err := h(c) + if assert.Error(t, err) { + assert.Equal(t, http.StatusOK, rec.Code) + + delim := []byte("\n")[0] + for { + line, err := rec.Body.ReadBytes(delim) + if err != nil { + if !assert.ErrorIs(t, err, io.EOF) { + t.Logf("STREAM-ERROR: %v\n", err) + } + break + } + var result TranscriptionResult + if err := json.Unmarshal(line, &result); err != nil { + t.Error(err) + } + + assert.Equal(t, "error", result.Type) + if assert.NotEmpty(t, result.Reason) { + assert.Equal(t, "STREAM-ERROR", result.Reason) + assert.Empty(t, result.Message) + } + } + } + + }) } From c3bf4d2568b85f190dfece8a65f091e4c9a8eb9f Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 19 Jan 2024 14:09:18 +0900 Subject: [PATCH 13/42] =?UTF-8?q?OnResultFunc=20=E3=81=A7=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=82=82=20JSON=20=E3=82=92=E8=BF=94=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 4 ++++ speech_to_text_handler.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 3052d75..705b15b 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -103,6 +103,10 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) case *transcribestreamingservice.TranscriptEvent: if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, e.Transcript.Results); err != nil { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + // TODO: ログを書く + } w.CloseWithError(err) return } diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 4e3fbcd..7fbe192 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -144,6 +144,10 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, resp.Results); err != nil { + errResponse := NewSuzuErrorResponse(err.Error()) + if err := encoder.Encode(errResponse); err != nil { + // TODO: ログを書く + } w.CloseWithError(err) return } From 20c55baff0854c56cd34696a4427a2d0250c91ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 15:25:05 +0000 Subject: [PATCH 14/42] fix(deps): update golang.org/x/exp digest to 1b97071 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3ed308a..12828e4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pion/rtp v1.8.3 github.com/rs/zerolog v1.31.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 google.golang.org/api v0.156.0 diff --git a/go.sum b/go.sum index ba272f1..d3c0748 100644 --- a/go.sum +++ b/go.sum @@ -183,6 +183,8 @@ golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcH golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= From 9942a9ce96487b2986571ee1ffc86f3670ed17ee Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 15:25:16 +0000 Subject: [PATCH 15/42] fix(deps): update all non-major dependencies --- go.mod | 10 +++++----- go.sum | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 12828e4..ea4d14d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.6 require ( cloud.google.com/go/speech v1.21.0 - github.com/aws/aws-sdk-go v1.49.21 + github.com/aws/aws-sdk-go v1.50.0 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 @@ -14,7 +14,7 @@ require ( golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.156.0 + google.golang.org/api v0.157.0 google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 @@ -63,8 +63,8 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d3c0748..9189c77 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/aws/aws-sdk-go v1.49.16 h1:KAQwhLg296hfffRdh+itA9p7Nx/3cXS/qOa3uF9ssi github.com/aws/aws-sdk-go v1.49.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.49.21 h1:Rl8KW6HqkwzhATwvXhyr7vD4JFUMi7oXGAw9SrxxIFY= github.com/aws/aws-sdk-go v1.49.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI= +github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -259,6 +261,8 @@ google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= google.golang.org/api v0.156.0 h1:yloYcGbBtVYjLKQe4enCunxvwn3s2w/XPrrhVf6MsvQ= google.golang.org/api v0.156.0/go.mod h1:bUSmn4KFO0Q+69zo9CNIDp4Psi6BqM0np0CbzKRSiSY= +google.golang.org/api v0.157.0 h1:ORAeqmbrrozeyw5NjnMxh7peHO0UzV4wWYSwZeCUb20= +google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -272,18 +276,24 @@ google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41 google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 h1:EWIeHfGuUf00zrVZGEgYFxok7plSAXBGcH7NNdMAWvA= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= From 41562cbdd3acfdab401e0c96452a5e0f4e45cdea Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 24 Jan 2024 12:53:40 +0900 Subject: [PATCH 16/42] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E9=80=81=E4=BF=A1=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=81=AB=E5=87=BA=E5=8A=9B=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 9 ++++++--- speech_to_text_handler.go | 9 ++++++--- test_handler.go | 20 ++++++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 705b15b..fe6866c 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -103,9 +103,12 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) case *transcribestreamingservice.TranscriptEvent: if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, e.Transcript.Results); err != nil { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - // TODO: ログを書く + if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() } w.CloseWithError(err) return diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 7fbe192..5681390 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -144,9 +144,12 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, resp.Results); err != nil { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - // TODO: ログを書く + if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() } w.CloseWithError(err) return diff --git a/test_handler.go b/test_handler.go index 4b143fe..15fc137 100644 --- a/test_handler.go +++ b/test_handler.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" "io" + + zlog "github.com/rs/zerolog/log" ) func init() { @@ -61,9 +63,12 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea n, err := reader.Read(buf) if err != nil { if err != io.EOF { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - // TODO: ログを書く + if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() } } w.CloseWithError(err) @@ -77,9 +82,12 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, result); err != nil { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { - // TODO: ログを書く + if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() } w.CloseWithError(err) return From 04abd753efc5a4310fdf3b2af7108a6793d53597 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 25 Jan 2024 16:43:25 +0900 Subject: [PATCH 17/42] =?UTF-8?q?=E7=B5=82=E4=BA=86=E6=99=82=E3=81=AE?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=83=BC=E3=83=A0=E3=81=AB=E9=80=81=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.go b/handler.go index cd53e92..5e7b8ba 100644 --- a/handler.go +++ b/handler.go @@ -144,7 +144,7 @@ func (s *Server) createSpeechHandler(serviceType string, onResultFunc func(conte Send() if err, ok := err.(*SuzuError); ok { // SuzuError の場合はその Status Code を返す - return echo.NewHTTPError(err.Code, err) + return c.NoContent(err.Code) } // SuzuError 以外の場合は 500 を返す From 85a442fe827c306e0da047e24b15eb0b87b0638d Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 25 Jan 2024 16:50:16 +0900 Subject: [PATCH 18/42] =?UTF-8?q?=E5=85=B1=E9=80=9A=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe.go | 47 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/amazon_transcribe.go b/amazon_transcribe.go index 3a5b010..e537875 100644 --- a/amazon_transcribe.go +++ b/amazon_transcribe.go @@ -11,14 +11,55 @@ import ( "github.com/aws/aws-sdk-go/service/transcribestreamingservice" ) +const ( + AccessDeniedException = "AccessDeniedException" + IncompleteSignature = "IncompleteSignature" + InternalFailure = "InternalFailure" + InvalidAction = "InvalidAction" + InvalidClientTokenID = "InvalidClientTokenId" + InvalidParameterCombination = "InvalidParameterCombination" + InvalidParameterValue = "InvalidParameterValue" + InvalidQueryParameter = "InvalidQueryParameter" + MalformedQueryString = "MalformedQueryString" + MissingAction = "MissingAction" + MissingAuthenticationToken = "MissingAuthenticationToken" + MissingParameter = "MissingParameter" + NotAuthorized = "NotAuthorized" + OptInRequired = "OptInRequired" + RequestExpired = "RequestExpired" + ServiceUnavailable = "ServiceUnavailable" + ThrottlingException = "ThrottlingException" + ValidationError = "ValidationError" +) + var ( - // https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html#API_streaming_StartStreamTranscription_Errors - amazonTranscribeStreamingServiceErrors = map[string]int{ + amazonErrors = map[string]int{ + // https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html#API_streaming_StartStreamTranscription_Errors transcribestreamingservice.ErrCodeLimitExceededException: 429, transcribestreamingservice.ErrCodeConflictException: 409, transcribestreamingservice.ErrCodeBadRequestException: 400, transcribestreamingservice.ErrCodeInternalFailureException: 500, transcribestreamingservice.ErrCodeServiceUnavailableException: 503, + + // https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html + AccessDeniedException: 400, + IncompleteSignature: 400, + InternalFailure: 500, + InvalidAction: 400, + InvalidClientTokenID: 403, + InvalidParameterCombination: 400, + InvalidParameterValue: 400, + InvalidQueryParameter: 400, + MalformedQueryString: 404, + MissingAction: 400, + MissingAuthenticationToken: 403, + MissingParameter: 400, + NotAuthorized: 400, + OptInRequired: 403, + RequestExpired: 400, + ServiceUnavailable: 503, + ThrottlingException: 400, + ValidationError: 400, } ) @@ -108,7 +149,7 @@ func (at *AmazonTranscribe) Start(ctx context.Context, r io.Reader) (*transcribe resp, err := client.StartStreamTranscriptionWithContext(ctx, &input) if err != nil { if awsErr, ok := err.(awserr.Error); ok { - code, ok := amazonTranscribeStreamingServiceErrors[awsErr.Code()] + code, ok := amazonErrors[awsErr.Code()] if !ok { return nil, err } From 9ded62391b589cf586aa79e5a2c17bb98aeeab15 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 15:20:26 +0000 Subject: [PATCH 19/42] fix(deps): update all non-major dependencies --- go.mod | 18 +++++++++--------- go.sum | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index ea4d14d..7a59e2d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.6 require ( cloud.google.com/go/speech v1.21.0 - github.com/aws/aws-sdk-go v1.50.0 + github.com/aws/aws-sdk-go v1.50.5 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 @@ -14,8 +14,8 @@ require ( golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.157.0 - google.golang.org/grpc v1.60.1 + google.golang.org/api v0.159.0 + google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -30,7 +30,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -52,11 +52,11 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect + go.opentelemetry.io/otel v1.22.0 // indirect + go.opentelemetry.io/otel/metric v1.22.0 // indirect + go.opentelemetry.io/otel/trace v1.22.0 // indirect golang.org/x/crypto v0.18.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/sys v0.16.0 // indirect diff --git a/go.sum b/go.sum index 9189c77..97a803b 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,8 @@ github.com/aws/aws-sdk-go v1.49.21 h1:Rl8KW6HqkwzhATwvXhyr7vD4JFUMi7oXGAw9SrxxIF github.com/aws/aws-sdk-go v1.49.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI= github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.5 h1:H2Aadcgwr7a2aqS6ZwcE+l1mA6ZrTseYCvjw2QLmxIA= +github.com/aws/aws-sdk-go v1.50.5/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -49,6 +51,8 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -157,14 +161,24 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= +go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= +go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= +go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -263,6 +277,8 @@ google.golang.org/api v0.156.0 h1:yloYcGbBtVYjLKQe4enCunxvwn3s2w/XPrrhVf6MsvQ= google.golang.org/api v0.156.0/go.mod h1:bUSmn4KFO0Q+69zo9CNIDp4Psi6BqM0np0CbzKRSiSY= google.golang.org/api v0.157.0 h1:ORAeqmbrrozeyw5NjnMxh7peHO0UzV4wWYSwZeCUb20= google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g= +google.golang.org/api v0.159.0 h1:fVTj+7HHiUYz4JEZCHHoRIeQX7h5FMzrA2RF/DzDdbs= +google.golang.org/api v0.159.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -303,6 +319,8 @@ google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From c9b02bbd54de0a9337ab2592d3644bbd1d9250e3 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 30 Jan 2024 15:14:26 +0900 Subject: [PATCH 20/42] =?UTF-8?q?err=20=E3=81=8C=20awserr.RequestFailure?= =?UTF-8?q?=20=E3=81=AE=E5=A0=B4=E5=90=88=E3=81=AF=20StatusCode=20?= =?UTF-8?q?=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe.go | 62 +++----------------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/amazon_transcribe.go b/amazon_transcribe.go index e537875..0b0e4da 100644 --- a/amazon_transcribe.go +++ b/amazon_transcribe.go @@ -11,58 +11,6 @@ import ( "github.com/aws/aws-sdk-go/service/transcribestreamingservice" ) -const ( - AccessDeniedException = "AccessDeniedException" - IncompleteSignature = "IncompleteSignature" - InternalFailure = "InternalFailure" - InvalidAction = "InvalidAction" - InvalidClientTokenID = "InvalidClientTokenId" - InvalidParameterCombination = "InvalidParameterCombination" - InvalidParameterValue = "InvalidParameterValue" - InvalidQueryParameter = "InvalidQueryParameter" - MalformedQueryString = "MalformedQueryString" - MissingAction = "MissingAction" - MissingAuthenticationToken = "MissingAuthenticationToken" - MissingParameter = "MissingParameter" - NotAuthorized = "NotAuthorized" - OptInRequired = "OptInRequired" - RequestExpired = "RequestExpired" - ServiceUnavailable = "ServiceUnavailable" - ThrottlingException = "ThrottlingException" - ValidationError = "ValidationError" -) - -var ( - amazonErrors = map[string]int{ - // https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html#API_streaming_StartStreamTranscription_Errors - transcribestreamingservice.ErrCodeLimitExceededException: 429, - transcribestreamingservice.ErrCodeConflictException: 409, - transcribestreamingservice.ErrCodeBadRequestException: 400, - transcribestreamingservice.ErrCodeInternalFailureException: 500, - transcribestreamingservice.ErrCodeServiceUnavailableException: 503, - - // https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html - AccessDeniedException: 400, - IncompleteSignature: 400, - InternalFailure: 500, - InvalidAction: 400, - InvalidClientTokenID: 403, - InvalidParameterCombination: 400, - InvalidParameterValue: 400, - InvalidQueryParameter: 400, - MalformedQueryString: 404, - MissingAction: 400, - MissingAuthenticationToken: 403, - MissingParameter: 400, - NotAuthorized: 400, - OptInRequired: 403, - RequestExpired: 400, - ServiceUnavailable: 503, - ThrottlingException: 400, - ValidationError: 400, - } -) - type AmazonTranscribe struct { LanguageCode string MediaEncoding string @@ -148,14 +96,12 @@ func (at *AmazonTranscribe) Start(ctx context.Context, r io.Reader) (*transcribe resp, err := client.StartStreamTranscriptionWithContext(ctx, &input) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - code, ok := amazonErrors[awsErr.Code()] - if !ok { - return nil, err - } + if reqErr, ok := err.(awserr.RequestFailure); ok { + code := reqErr.StatusCode() + message := reqErr.Message() return nil, &SuzuError{ Code: code, - Message: awsErr.Message(), + Message: message, } } return nil, err From a4be6feca0aa8076803f46b5e19a24343ae6fb15 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 30 Jan 2024 15:21:20 +0900 Subject: [PATCH 21/42] =?UTF-8?q?=E5=9E=8B=E3=82=92=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=97=E3=81=A6=E4=BD=BF=E3=81=84=E3=82=84=E3=81=99=E3=81=8F?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 5 ++--- handler.go | 4 ++-- speech_to_text_handler.go | 2 +- test_handler.go | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index fe6866c..5cff578 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -103,7 +103,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) case *transcribestreamingservice.TranscriptEvent: if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, e.Transcript.Results); err != nil { - if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). @@ -149,8 +149,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) } if err := stream.Err(); err != nil { - errResponse := NewSuzuErrorResponse(err.Error()) - if err := encoder.Encode(errResponse); err != nil { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). diff --git a/handler.go b/handler.go index 5e7b8ba..c348a42 100644 --- a/handler.go +++ b/handler.go @@ -30,10 +30,10 @@ type TranscriptionResult struct { Type string `json:"type"` } -func NewSuzuErrorResponse(message string) TranscriptionResult { +func NewSuzuErrorResponse(err error) TranscriptionResult { return TranscriptionResult{ Type: "error", - Reason: message, + Reason: err.Error(), } } diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 5681390..4441b30 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -144,7 +144,7 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, resp.Results); err != nil { - if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). diff --git a/test_handler.go b/test_handler.go index 15fc137..a8c3912 100644 --- a/test_handler.go +++ b/test_handler.go @@ -63,7 +63,7 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea n, err := reader.Read(buf) if err != nil { if err != io.EOF { - if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). @@ -82,7 +82,7 @@ func (h *TestHandler) Handle(ctx context.Context, reader io.Reader) (*io.PipeRea if h.OnResultFunc != nil { if err := h.OnResultFunc(ctx, w, h.ChannelID, h.ConnectionID, h.LanguageCode, result); err != nil { - if err := encoder.Encode(NewSuzuErrorResponse(err.Error())); err != nil { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). From 017d8b2ce4825bc365ffb3f8c6db3e5a10a9213a Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 31 Jan 2024 12:00:20 +0900 Subject: [PATCH 22/42] =?UTF-8?q?EOF=20=E6=99=82=E3=81=AF=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=82=92=E5=87=BA=E3=81=95=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 13 ++++++++----- speech_to_text_handler.go | 12 +++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 5cff578..4527a2e 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -73,11 +73,14 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) go func() { defer oggWriter.Close() if err := opus2ogg(ctx, reader, oggWriter, h.SampleRate, h.ChannelCount, h.Config); err != nil { - zlog.Error(). - Err(err). - Str("channel_id", h.ChannelID). - Str("connection_id", h.ConnectionID). - Send() + if err != io.EOF { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + oggWriter.CloseWithError(err) return } diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 4441b30..705ab79 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -75,11 +75,13 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io go func() { defer oggWriter.Close() if err := opus2ogg(ctx, reader, oggWriter, h.SampleRate, h.ChannelCount, h.Config); err != nil { - zlog.Error(). - Err(err). - Str("channel_id", h.ChannelID). - Str("connection_id", h.ConnectionID). - Send() + if err != io.EOF { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } oggWriter.CloseWithError(err) return } From 7b734e9d3c77fb0bd33533468ad2ffc15ec877a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:59:34 +0000 Subject: [PATCH 23/42] fix(deps): update all non-major dependencies --- go.mod | 14 +++++++------- go.sum | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 7a59e2d..8575225 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,18 @@ module github.com/shiguredo/suzu go 1.21.6 require ( - cloud.google.com/go/speech v1.21.0 - github.com/aws/aws-sdk-go v1.50.5 + cloud.google.com/go/speech v1.21.1 + github.com/aws/aws-sdk-go v1.50.10 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 github.com/pion/rtp v1.8.3 - github.com/rs/zerolog v1.31.0 + github.com/rs/zerolog v1.32.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.159.0 + google.golang.org/api v0.161.0 google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 @@ -63,8 +63,8 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 97a803b..1fcc8f3 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgG cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= cloud.google.com/go/speech v1.21.0 h1:qkxNao58oF8ghAHE1Eghen7XepawYEN5zuZXYWaUTA4= cloud.google.com/go/speech v1.21.0/go.mod h1:wwolycgONvfz2EDU8rKuHRW3+wc9ILPsAWoikBEWavY= +cloud.google.com/go/speech v1.21.1 h1:nuFc+Kj5B8de75nN4FdPyUbI2SiBoHZG6BLurXL56Q0= +cloud.google.com/go/speech v1.21.1/go.mod h1:E5GHZXYQlkqWQwY5xRSLHw2ci5NMQNG52FfMU1aZrIA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/aws/aws-sdk-go v1.49.4 h1:qiXsqEeLLhdLgUIyfr5ot+N/dGPWALmtM1SetRmbUlY= github.com/aws/aws-sdk-go v1.49.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= @@ -26,6 +28,8 @@ github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.50.5 h1:H2Aadcgwr7a2aqS6ZwcE+l1mA6ZrTseYCvjw2QLmxIA= github.com/aws/aws-sdk-go v1.50.5/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE= +github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -142,6 +146,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -279,6 +285,8 @@ google.golang.org/api v0.157.0 h1:ORAeqmbrrozeyw5NjnMxh7peHO0UzV4wWYSwZeCUb20= google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g= google.golang.org/api v0.159.0 h1:fVTj+7HHiUYz4JEZCHHoRIeQX7h5FMzrA2RF/DzDdbs= google.golang.org/api v0.159.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= +google.golang.org/api v0.161.0 h1:oYzk/bs26WN10AV7iU7MVJVXBH8oCPS2hHyBiEeFoSU= +google.golang.org/api v0.161.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -294,6 +302,8 @@ google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= +google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= +google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 h1:EWIeHfGuUf00zrVZGEgYFxok7plSAXBGcH7NNdMAWvA= @@ -302,6 +312,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1: google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= +google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= +google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= @@ -310,6 +322,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= From 9fda724cc5c4d19008d6874577dabf5d8069f7da Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 7 Feb 2024 10:17:25 +0900 Subject: [PATCH 24/42] =?UTF-8?q?go-1.22=20=E3=81=AB=E4=B8=8A=E3=81=92?= =?UTF-8?q?=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8575225..955a313 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/shiguredo/suzu -go 1.21.6 +go 1.22.0 require ( cloud.google.com/go/speech v1.21.1 From d9c6998b97b2e1f0d0b90402d04070ee15d2ec8b Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 9 Feb 2024 11:54:47 +0900 Subject: [PATCH 25/42] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech_to_text_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 705ab79..a353c11 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -116,7 +116,7 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io w.CloseWithError(err) return } - if status := resp.Error; err != nil { + if status := resp.Error; status != nil { // 音声の長さの上限値に達した場合 code := codes.Code(status.GetCode()) if code == codes.OutOfRange || From 56309d12c7918a63cb2973084493ee6b23093890 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 9 Feb 2024 12:55:33 +0900 Subject: [PATCH 26/42] =?UTF-8?q?gcp=20=E3=81=AE=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=82=82=E3=82=A8=E3=83=A9=E3=83=BC=E6=99=82=E3=81=AB=E3=81=AF?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E9=80=81?= =?UTF-8?q?=E4=BF=A1=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech_to_text_handler.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index a353c11..80accaf 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -3,6 +3,7 @@ package suzu import ( "context" "encoding/json" + "fmt" "io" "strings" @@ -106,6 +107,14 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io Str("connection_id", h.ConnectionID). Send() + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + if (strings.Contains(err.Error(), "code = OutOfRange")) || (strings.Contains(err.Error(), "code = InvalidArgument")) || (strings.Contains(err.Error(), "code = ResourceExhausted")) { @@ -117,6 +126,14 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io return } if status := resp.Error; status != nil { + err := fmt.Errorf(status.GetMessage()) + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } // 音声の長さの上限値に達した場合 code := codes.Code(status.GetCode()) if code == codes.OutOfRange || From 0a76bc1c894f91f3f654c9d0c82403ca7dc4e657 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 9 Feb 2024 17:00:05 +0900 Subject: [PATCH 27/42] =?UTF-8?q?=E3=83=AA=E3=83=88=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=99=82=E3=81=AB=E3=81=AF=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AF?= =?UTF-8?q?=E9=80=81=E3=82=89=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 16 ++++++++-------- speech_to_text_handler.go | 34 ++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 4527a2e..e23ee0f 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -152,14 +152,6 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) } if err := stream.Err(); err != nil { - if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { - zlog.Error(). - Err(err). - Str("channel_id", h.ChannelID). - Str("connection_id", h.ConnectionID). - Send() - } - // 復帰が不可能なエラー以外は再接続を試みる switch err.(type) { case *transcribestreamingservice.LimitExceededException, @@ -172,6 +164,14 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) err = ErrServerDisconnected default: + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + } w.CloseWithError(err) diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index 80accaf..e66bc9f 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -107,14 +107,6 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io Str("connection_id", h.ConnectionID). Send() - if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { - zlog.Error(). - Err(err). - Str("channel_id", h.ChannelID). - Str("connection_id", h.ConnectionID). - Send() - } - if (strings.Contains(err.Error(), "code = OutOfRange")) || (strings.Contains(err.Error(), "code = InvalidArgument")) || (strings.Contains(err.Error(), "code = ResourceExhausted")) { @@ -122,11 +114,6 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io return } - w.CloseWithError(err) - return - } - if status := resp.Error; status != nil { - err := fmt.Errorf(status.GetMessage()) if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). @@ -134,6 +121,11 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io Str("connection_id", h.ConnectionID). Send() } + + w.CloseWithError(err) + return + } + if status := resp.Error; status != nil { // 音声の長さの上限値に達した場合 code := codes.Code(status.GetCode()) if code == codes.OutOfRange || @@ -146,16 +138,26 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io Str("connection_id", h.ConnectionID). Int32("code", status.GetCode()). Msg(status.GetMessage()) - err := ErrServerDisconnected - w.CloseWithError(err) + w.CloseWithError(ErrServerDisconnected) return } + + errMessage := status.GetMessage() zlog.Error(). Str("channel_id", h.ChannelID). Str("connection_id", h.ConnectionID). Int32("code", status.GetCode()). - Msg(status.GetMessage()) + Msg(errMessage) + + err := fmt.Errorf(errMessage) + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } w.Close() return From 2a442a9dbab46bc215413ea97225b81e8b5b784c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 15:45:57 +0000 Subject: [PATCH 28/42] fix(deps): update golang.org/x/exp digest to 2c58cdc --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 955a313..1ec2930 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pion/rtp v1.8.3 github.com/rs/zerolog v1.32.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a + golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 google.golang.org/api v0.161.0 diff --git a/go.sum b/go.sum index 1fcc8f3..bd826ce 100644 --- a/go.sum +++ b/go.sum @@ -207,6 +207,8 @@ golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= +golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= From 06ddaf8c4513f5bd8906d29222a1e4ccdd2bf5f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 20:01:02 +0000 Subject: [PATCH 29/42] fix(deps): update all non-major dependencies --- go.mod | 10 +++++----- go.sum | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 1ec2930..ecaefbd 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( cloud.google.com/go/speech v1.21.1 - github.com/aws/aws-sdk-go v1.50.10 + github.com/aws/aws-sdk-go v1.50.15 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 @@ -12,9 +12,9 @@ require ( github.com/rs/zerolog v1.32.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 - golang.org/x/net v0.20.0 + golang.org/x/net v0.21.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.161.0 + google.golang.org/api v0.163.0 google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 @@ -57,9 +57,9 @@ require ( go.opentelemetry.io/otel v1.22.0 // indirect go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect - golang.org/x/crypto v0.18.0 // indirect + golang.org/x/crypto v0.19.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/go.sum b/go.sum index bd826ce..a1338bd 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/aws/aws-sdk-go v1.50.5 h1:H2Aadcgwr7a2aqS6ZwcE+l1mA6ZrTseYCvjw2QLmxIA github.com/aws/aws-sdk-go v1.50.5/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE= github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.15 h1:wEMnPfEQQFaoIJwuO18zq/vtG4Ft7NxQ3r9xlEi/8zg= +github.com/aws/aws-sdk-go v1.50.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -194,6 +196,8 @@ golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -226,6 +230,8 @@ golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +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/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= @@ -258,6 +264,8 @@ golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -289,6 +297,8 @@ google.golang.org/api v0.159.0 h1:fVTj+7HHiUYz4JEZCHHoRIeQX7h5FMzrA2RF/DzDdbs= google.golang.org/api v0.159.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= google.golang.org/api v0.161.0 h1:oYzk/bs26WN10AV7iU7MVJVXBH8oCPS2hHyBiEeFoSU= google.golang.org/api v0.161.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= +google.golang.org/api v0.163.0 h1:4BBDpPaSH+H28NhnX+WwjXxbRLQ7TWuEKp4BQyEjxvk= +google.golang.org/api v0.163.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= From b66a1aaabb70e4631a7dfacf90e447fd2012791d Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 13 Feb 2024 12:10:52 +0900 Subject: [PATCH 30/42] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index e23ee0f..5f07120 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -164,6 +164,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) err = ErrServerDisconnected default: + // 再接続を想定している以外のエラーの場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { zlog.Error(). Err(err). @@ -171,7 +172,6 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) Str("connection_id", h.ConnectionID). Send() } - } w.CloseWithError(err) From f168fb20780938af1962ab97843ac087cd5c246b Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 13 Feb 2024 12:12:21 +0900 Subject: [PATCH 31/42] =?UTF-8?q?=E5=86=8D=E6=8E=A5=E7=B6=9A=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=82=92=20LimitExceededException=20=E3=81=AB?= =?UTF-8?q?=E7=B5=9E=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 5f07120..ac6d9a2 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -154,8 +154,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) if err := stream.Err(); err != nil { // 復帰が不可能なエラー以外は再接続を試みる switch err.(type) { - case *transcribestreamingservice.LimitExceededException, - *transcribestreamingservice.InternalFailureException: + case *transcribestreamingservice.LimitExceededException: zlog.Error(). Err(err). Str("channel_id", h.ChannelID). From 2a4f84d148f164adb4d8e8d86df9d95e0675765f Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 13 Feb 2024 13:19:57 +0900 Subject: [PATCH 32/42] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_handler_test.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test_handler_test.go b/test_handler_test.go index 05a33a0..57541ff 100644 --- a/test_handler_test.go +++ b/test_handler_test.go @@ -373,24 +373,32 @@ func TestSpeechHandler(t *testing.T) { c := e.NewContext(req, rec) h := s.createSpeechHandler(serviceType, func(ctx context.Context, w io.WriteCloser, chnanelID, connectionID, languageCode string, results any) error { - return fmt.Errorf("STREAM-ERROR") + go func() { + defer w.Close() + + encoder := json.NewEncoder(w) + if err := encoder.Encode(NewSuzuErrorResponse(fmt.Errorf("STREAM-ERROR"))); err != nil { + return + } + }() + + return nil }) err := h(c) - if assert.Error(t, err) { + if assert.NoError(t, err) { assert.Equal(t, http.StatusOK, rec.Code) delim := []byte("\n")[0] for { line, err := rec.Body.ReadBytes(delim) if err != nil { - if !assert.ErrorIs(t, err, io.EOF) { - t.Logf("STREAM-ERROR: %v\n", err) - } + assert.ErrorIs(t, err, io.EOF) break } + var result TranscriptionResult if err := json.Unmarshal(line, &result); err != nil { - t.Error(err) + assert.ErrorIs(t, err, io.EOF) } assert.Equal(t, "error", result.Type) From ee2556da75e1f19c996c6f00d467b1fe0c707f17 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Tue, 13 Feb 2024 17:07:49 +0900 Subject: [PATCH 33/42] =?UTF-8?q?=E3=83=AA=E3=83=88=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=81=8C=E7=84=A1=E5=8A=B9=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AF?= =?UTF-8?q?=E5=86=8D=E6=8E=A5=E7=B6=9A=E3=81=AE=E6=9D=A1=E4=BB=B6=E3=81=AB?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E3=81=97=E3=81=A6=E3=82=82=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=83=B3=E3=83=88=E3=81=AB=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=92=E9=80=81=E4=BF=A1=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 11 +++++++++++ speech_to_text_handler.go | 14 +++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index ac6d9a2..6803f78 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -161,6 +161,17 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) Str("connection_id", h.ConnectionID). Send() + // リトライしない設定の場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する + if !*at.Config.Retry { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + } + err = ErrServerDisconnected default: // 再接続を想定している以外のエラーの場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index e66bc9f..ce15e89 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -132,12 +132,24 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io code == codes.InvalidArgument || code == codes.ResourceExhausted { + err := fmt.Errorf(status.GetMessage()) zlog.Error(). Err(err). Str("channel_id", h.ChannelID). Str("connection_id", h.ConnectionID). Int32("code", status.GetCode()). - Msg(status.GetMessage()) + Send() + + // リトライしない設定の場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する + if !*stt.Config.Retry { + if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil { + zlog.Error(). + Err(err). + Str("channel_id", h.ChannelID). + Str("connection_id", h.ConnectionID). + Send() + } + } w.CloseWithError(ErrServerDisconnected) return From 5828e846169ce243d68b119c830c4135d3799b52 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 14 Feb 2024 16:25:17 +0900 Subject: [PATCH 34/42] =?UTF-8?q?=E3=82=B3=E3=82=B9=E3=83=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amazon_transcribe_handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amazon_transcribe_handler.go b/amazon_transcribe_handler.go index 6803f78..32214b2 100644 --- a/amazon_transcribe_handler.go +++ b/amazon_transcribe_handler.go @@ -3,6 +3,7 @@ package suzu import ( "context" "encoding/json" + "errors" "io" "github.com/aws/aws-sdk-go/service/transcribestreamingservice" @@ -73,7 +74,7 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader) go func() { defer oggWriter.Close() if err := opus2ogg(ctx, reader, oggWriter, h.SampleRate, h.ChannelCount, h.Config); err != nil { - if err != io.EOF { + if !errors.Is(err, io.EOF) { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). From 4de7c943a4aefc74156dd7e5abf5a75773b8d9dc Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Wed, 14 Feb 2024 16:46:11 +0900 Subject: [PATCH 35/42] =?UTF-8?q?EOF=20=E3=81=AF=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=81=AB=E5=87=BA=E3=81=95=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech_to_text_handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/speech_to_text_handler.go b/speech_to_text_handler.go index ce15e89..e49dea0 100644 --- a/speech_to_text_handler.go +++ b/speech_to_text_handler.go @@ -3,6 +3,7 @@ package suzu import ( "context" "encoding/json" + "errors" "fmt" "io" "strings" @@ -76,7 +77,7 @@ func (h *SpeechToTextHandler) Handle(ctx context.Context, reader io.Reader) (*io go func() { defer oggWriter.Close() if err := opus2ogg(ctx, reader, oggWriter, h.SampleRate, h.ChannelCount, h.Config); err != nil { - if err != io.EOF { + if !errors.Is(err, io.EOF) { zlog.Error(). Err(err). Str("channel_id", h.ChannelID). From bb892d4c73d95e3f2db5b2f68b2049738b392f92 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 15 Feb 2024 11:09:04 +0900 Subject: [PATCH 36/42] =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E5=87=A6=E7=90=86=E5=89=8D=E3=81=AE=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=92=20SuzuError=20=E3=81=AB=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech_to_text.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/speech_to_text.go b/speech_to_text.go index 295e820..9700265 100644 --- a/speech_to_text.go +++ b/speech_to_text.go @@ -43,17 +43,26 @@ func (stt SpeechToText) Start(ctx context.Context, r io.Reader) (speechpb.Speech client, err := speech.NewClient(ctx, opts...) if err != nil { - return nil, err + return nil, &SuzuError{ + Code: 500, + Message: err.Error(), + } } stream, err := client.StreamingRecognize(ctx) if err != nil { - return nil, err + return nil, &SuzuError{ + Code: 500, + Message: err.Error(), + } } if err := stream.Send(&speechpb.StreamingRecognizeRequest{ StreamingRequest: streamingRecognitionConfig, }); err != nil { - return nil, err + return nil, &SuzuError{ + Code: 500, + Message: err.Error(), + } } go func() { From 6f26dcb349bc19f2ecfca9ac70c772f0fccc01ae Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 15 Feb 2024 11:18:59 +0900 Subject: [PATCH 37/42] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 55c1066..3609c21 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,14 @@ ## develop +- [CHANGE] サービス接続時にエラーになった場合は、Body が空のレスポンスを返すように変更する + - @Hexa +- [CHANGE] サービス接続後にエラーになった場合は、{"type": "error", "reason": string} をクライアントへ送信するように変更する + - @Hexa +- [CHANGE] aws の再接続条件の exception から InternalFailureException を削除する + - @Hexa + + ## 2023.5.3 - [FIX] VERSION ファイルを tag のバージョンに修正する From 2174edf3a82b634441502bf2941720fafdc68ffa Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 15 Feb 2024 11:39:17 +0900 Subject: [PATCH 38/42] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech_to_text.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/speech_to_text.go b/speech_to_text.go index 9700265..3dcafd6 100644 --- a/speech_to_text.go +++ b/speech_to_text.go @@ -44,6 +44,7 @@ func (stt SpeechToText) Start(ctx context.Context, r io.Reader) (speechpb.Speech client, err := speech.NewClient(ctx, opts...) if err != nil { return nil, &SuzuError{ + // TODO: 適切な StatusCode に変更する Code: 500, Message: err.Error(), } @@ -51,6 +52,7 @@ func (stt SpeechToText) Start(ctx context.Context, r io.Reader) (speechpb.Speech stream, err := client.StreamingRecognize(ctx) if err != nil { return nil, &SuzuError{ + // TODO: 適切な StatusCode に変更する Code: 500, Message: err.Error(), } @@ -60,6 +62,7 @@ func (stt SpeechToText) Start(ctx context.Context, r io.Reader) (speechpb.Speech StreamingRequest: streamingRecognitionConfig, }); err != nil { return nil, &SuzuError{ + // TODO: 適切な StatusCode に変更する Code: 500, Message: err.Error(), } From 5e4e2dd0cc1d050420f2d761029f611a06f89b46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:12:39 +0000 Subject: [PATCH 39/42] fix(deps): update golang.org/x/exp digest to ec58324 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ecaefbd..d3a82ce 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pion/rtp v1.8.3 github.com/rs/zerolog v1.32.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/net v0.21.0 golang.org/x/sync v0.6.0 google.golang.org/api v0.163.0 diff --git a/go.sum b/go.sum index a1338bd..3bc14c1 100644 --- a/go.sum +++ b/go.sum @@ -213,6 +213,8 @@ golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRj golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= From 5cf28f08f25fa205acebd5414e84c8c554737ad6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:13:05 +0000 Subject: [PATCH 40/42] fix(deps): update all non-major dependencies --- go.mod | 20 ++++++++++---------- go.sum | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index d3a82ce..e8a58ac 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( cloud.google.com/go/speech v1.21.1 - github.com/aws/aws-sdk-go v1.50.15 + github.com/aws/aws-sdk-go v1.50.20 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo/v4 v4.11.4 github.com/pion/randutil v0.1.0 @@ -14,15 +14,15 @@ require ( golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/net v0.21.0 golang.org/x/sync v0.6.0 - google.golang.org/api v0.163.0 - google.golang.org/grpc v1.61.0 + google.golang.org/api v0.165.0 + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( - cloud.google.com/go v0.111.0 // indirect + cloud.google.com/go v0.112.0 // indirect cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/longrunning v0.5.4 // indirect @@ -54,17 +54,17 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.opentelemetry.io/otel v1.23.0 // indirect + go.opentelemetry.io/otel/metric v1.23.0 // indirect + go.opentelemetry.io/otel/trace v1.23.0 // indirect golang.org/x/crypto v0.19.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3bc14c1..e0ea80e 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= @@ -32,6 +34,8 @@ github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGq github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.50.15 h1:wEMnPfEQQFaoIJwuO18zq/vtG4Ft7NxQ3r9xlEi/8zg= github.com/aws/aws-sdk-go v1.50.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.20 h1:xfAnSDVf/azIWTVQXQODp89bubvCS85r70O3nuQ4dnE= +github.com/aws/aws-sdk-go v1.50.20/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -179,14 +183,20 @@ go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -239,6 +249,8 @@ golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -301,6 +313,8 @@ google.golang.org/api v0.161.0 h1:oYzk/bs26WN10AV7iU7MVJVXBH8oCPS2hHyBiEeFoSU= google.golang.org/api v0.161.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= google.golang.org/api v0.163.0 h1:4BBDpPaSH+H28NhnX+WwjXxbRLQ7TWuEKp4BQyEjxvk= google.golang.org/api v0.163.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= +google.golang.org/api v0.165.0 h1:zd5d4JIIIaYYsfVy1HzoXYZ9rWCSBxxAglbczzo7Bgc= +google.golang.org/api v0.165.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -318,6 +332,8 @@ google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFx google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= +google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= +google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 h1:EWIeHfGuUf00zrVZGEgYFxok7plSAXBGcH7NNdMAWvA= @@ -338,6 +354,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -349,6 +367,8 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 20addee23483a263f3aa6c9c105ef7faa1c4d813 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 22 Feb 2024 15:41:37 +0900 Subject: [PATCH 41/42] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d4a8072..a73a851 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2023.5.3 \ No newline at end of file +2024.1.0 From 3c654906e0572d6b713d50db6e7b52a5c45926a0 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Thu, 22 Feb 2024 15:42:46 +0900 Subject: [PATCH 42/42] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 3609c21..a75760a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,11 @@ ## develop + +## 2024.1.0 + +- [UPDATE] go.mod の Go のバージョンを 1.22.0 にあげる + - @voluntas - [CHANGE] サービス接続時にエラーになった場合は、Body が空のレスポンスを返すように変更する - @Hexa - [CHANGE] サービス接続後にエラーになった場合は、{"type": "error", "reason": string} をクライアントへ送信するように変更する