mirror of
https://codeberg.org/aryak/mozhi
synced 2024-11-29 04:22:06 +05:30
Merge master
This commit is contained in:
commit
b6c9335ae4
@ -1,5 +1,5 @@
|
||||
<div align="center">
|
||||
<img src="public/assets/mozhi.svg" width="192" height="192" alt="Mozhi logo">
|
||||
<img src="public/assets/mozhi.png" width="192" height="192" alt="Mozhi logo">
|
||||
<h1>Mozhi</h1>
|
||||
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html">
|
||||
@ -50,6 +50,8 @@ Features of Mozhi can be customized and toggled on/off using Environment Variabl
|
||||
|
||||
- `MOZHI_PORT`: Port the webserver listens on (if hosting API)
|
||||
- `MOZHI_LIBRETRANSLATE_URL`: URL of Libretranslate instance (Example: `MOZHI_LIBRETRANSLATE_URL=https://lt.psf.lt`)
|
||||
- `MOZHI_DEFAULT_SOURCE_LANG`: Language to default to if no source language is set by user. Defaults to Auto-Detect (or first available language in engines which dont support it)
|
||||
- `MOZHI_DEFAULT_TARGET_LANG`: Language to default to if no target language is set by user. Defaults to English
|
||||
|
||||
These envvars turn off/on engines. By default all of them are enabled.
|
||||
- `MOZHI_GOOGLE_ENABLED`
|
||||
@ -67,6 +69,7 @@ These envvars turn off/on engines. By default all of them are enabled.
|
||||
| -------- | ---------- | ----------- | ----- |
|
||||
| [mozhi.aryak.me](https://mozhi.aryak.me) | No | India | Airtel |
|
||||
| [translate.bus-hit.me](https://translate.bus-hit.me) | No | Canada | Oracle |
|
||||
| [nyc1.mz.ggtyler.dev](https://nyc1.mz.ggtyler.dev) | No | USA | Royale Hosting |
|
||||
|
||||
## Features
|
||||
- An all mode where the responses of all supported engines will be shown.
|
||||
|
1
TODO.md
1
TODO.md
@ -1,5 +1,4 @@
|
||||
# TODO
|
||||
- Make detectlanguage swap the text as well
|
||||
- Interactive/Step-by-step CLI
|
||||
- Ability for user to choose engines they want to use
|
||||
- Finish simplytranslate-py compatible API for translations
|
||||
|
46
docs/docs.go
46
docs/docs.go
@ -1,4 +1,5 @@
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
@ -15,6 +16,23 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/api/engines": {
|
||||
"get": {
|
||||
"description": "Lists available Engines.",
|
||||
"summary": "List engines",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/source_languages": {
|
||||
"get": {
|
||||
"summary": "Show list of available source languages for engine",
|
||||
@ -151,6 +169,12 @@ const docTemplate = `{
|
||||
},
|
||||
"translated-text": {
|
||||
"type": "string"
|
||||
},
|
||||
"word_choices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/libmozhi.WordChoices"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -164,6 +188,26 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"libmozhi.WordChoices": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"examples_source": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"examples_target": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"word": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
@ -4,6 +4,23 @@
|
||||
"contact": {}
|
||||
},
|
||||
"paths": {
|
||||
"/api/engines": {
|
||||
"get": {
|
||||
"description": "Lists available Engines.",
|
||||
"summary": "List engines",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/source_languages": {
|
||||
"get": {
|
||||
"summary": "Show list of available source languages for engine",
|
||||
@ -140,6 +157,12 @@
|
||||
},
|
||||
"translated-text": {
|
||||
"type": "string"
|
||||
},
|
||||
"word_choices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/libmozhi.WordChoices"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -153,6 +176,26 @@
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"libmozhi.WordChoices": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"examples_source": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"examples_target": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"word": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,10 @@ definitions:
|
||||
type: string
|
||||
translated-text:
|
||||
type: string
|
||||
word_choices:
|
||||
items:
|
||||
$ref: '#/definitions/libmozhi.WordChoices'
|
||||
type: array
|
||||
type: object
|
||||
libmozhi.List:
|
||||
properties:
|
||||
@ -19,9 +23,33 @@ definitions:
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
libmozhi.WordChoices:
|
||||
properties:
|
||||
examples_source:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
examples_target:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
word:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact: {}
|
||||
paths:
|
||||
/api/engines:
|
||||
get:
|
||||
description: Lists available Engines.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: List engines
|
||||
/api/source_languages:
|
||||
get:
|
||||
parameters:
|
||||
|
36
go.mod
36
go.mod
@ -4,14 +4,16 @@ go 1.21.0
|
||||
|
||||
replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-20230817133036-0eb71706cd51
|
||||
|
||||
//replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi
|
||||
|
||||
require (
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230929185231-f1715f74743d
|
||||
github.com/gofiber/fiber/v2 v2.49.2
|
||||
github.com/gofiber/swagger v0.1.13
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20231204134316-92dbad691dd1
|
||||
github.com/gofiber/fiber/v2 v2.51.0
|
||||
github.com/gofiber/swagger v0.1.14
|
||||
github.com/gofiber/template v1.8.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/ktr0731/go-fuzzyfinder v0.7.0
|
||||
github.com/spf13/cobra v1.7.0
|
||||
github.com/ktr0731/go-fuzzyfinder v0.8.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/swaggo/swag v1.16.2
|
||||
)
|
||||
|
||||
@ -19,24 +21,24 @@ require (
|
||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||
github.com/OwO-Network/gdeeplx v0.0.1 // indirect
|
||||
github.com/abadojack/whatlanggo v1.0.1 // indirect
|
||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||
github.com/carlmjohnson/requests v0.23.4 // indirect
|
||||
github.com/andybalholm/brotli v1.0.6 // indirect
|
||||
github.com/carlmjohnson/requests v0.23.5 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.6.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.20.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/spec v0.20.9 // indirect
|
||||
github.com/go-openapi/spec v0.20.11 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/google/uuid v1.4.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.17.0 // indirect
|
||||
github.com/klauspost/compress v1.17.4 // indirect
|
||||
github.com/ktr0731/go-ansisgr v0.1.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
||||
github.com/nsf/termbox-go v1.1.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
@ -48,12 +50,12 @@ require (
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.50.0 // indirect
|
||||
github.com/valyala/fasthttp v1.51.0 // indirect
|
||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||
golang.org/x/net v0.15.0 // indirect
|
||||
golang.org/x/sys v0.12.0 // indirect
|
||||
golang.org/x/term v0.12.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
golang.org/x/tools v0.13.0 // indirect
|
||||
golang.org/x/net v0.19.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
golang.org/x/term v0.15.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/tools v0.16.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
83
go.sum
83
go.sum
@ -45,12 +45,10 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230920102302-eae522fadce2 h1:WCL4zE30KGQLUBmCiKEbn8axb8+uU4xgrYMXPnL6Ok0=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230920102302-eae522fadce2/go.mod h1:DOxFxtSCKbs3sfKLxDwho9RFqkZy1opa67/c9v+/G+I=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230924060300-0f597921ab2d h1:SoXFIPKmoqy1EoeuEsqQpiXYU6WavjtxBauegsfsokM=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230924060300-0f597921ab2d/go.mod h1:DOxFxtSCKbs3sfKLxDwho9RFqkZy1opa67/c9v+/G+I=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230929185231-f1715f74743d h1:16Ov4sMb4jGixR+ZtR8oorRqv+62qkYx4m8vy5pcick=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20230929185231-f1715f74743d/go.mod h1:DOxFxtSCKbs3sfKLxDwho9RFqkZy1opa67/c9v+/G+I=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20231129152229-c0d8dfbccd68 h1:Pwsv6oLj51GhlcrlBIPc91jliNeJx6sPdPKYnzhZqMg=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20231129152229-c0d8dfbccd68/go.mod h1:Ohfzqv/+t2t350TFNlHNBIXc42lOdv+3MkBtozYxMUY=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20231204134316-92dbad691dd1 h1:bRxuxuTa8TAkc4WEEdDvtUB5olQpK1wlTnJbP7rly2A=
|
||||
codeberg.org/aryak/libmozhi v0.0.0-20231204134316-92dbad691dd1/go.mod h1:Ohfzqv/+t2t350TFNlHNBIXc42lOdv+3MkBtozYxMUY=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
@ -70,8 +68,9 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
|
||||
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
@ -83,8 +82,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/carlmjohnson/requests v0.23.4 h1:AxcvapfB9RPXLSyvAHk9YJoodQ43ZjzNHj6Ft3tQGdg=
|
||||
github.com/carlmjohnson/requests v0.23.4/go.mod h1:Qzp6tW4DQyainPP+tGwiJTzwxvElTIKm0B191TgTtOA=
|
||||
github.com/carlmjohnson/requests v0.23.5 h1:NPANcAofwwSuC6SIMwlgmHry2V3pLrSqRiSBKYbNHHA=
|
||||
github.com/carlmjohnson/requests v0.23.5/go.mod h1:zG9P28thdRnN61aD7iECFhH5iGGKX2jIjKQD9kqYH+o=
|
||||
github.com/cbroglie/mustache v1.4.0/go.mod h1:SS1FTIghy0sjse4DUVGV1k/40B1qE1XkD9DtDsHo9iM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
@ -111,7 +110,7 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
@ -160,6 +159,8 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
|
||||
github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I=
|
||||
github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8=
|
||||
github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
|
||||
github.com/go-openapi/spec v0.20.11 h1:J/TzFDLTt4Rcl/l1PmyErvkqlJDncGvPTMnCI39I4gY=
|
||||
github.com/go-openapi/spec v0.20.11/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
|
||||
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
@ -168,11 +169,11 @@ github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I=
|
||||
github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU=
|
||||
github.com/gofiber/fiber/v2 v2.49.2 h1:ONEN3/Vc+dUCxxDgZZwpqvhISgHqb+bu+isBiEyKEQs=
|
||||
github.com/gofiber/fiber/v2 v2.49.2/go.mod h1:gNsKnyrmfEWFpJxQAV0qvW6l70K1dZGno12oLtukcts=
|
||||
github.com/gofiber/swagger v0.1.13 h1:e7tMH/y34HIMklQ2+uv64Ai3E8TWCgbZyscIx+IzInE=
|
||||
github.com/gofiber/swagger v0.1.13/go.mod h1:VtNHZdI5ksFlIR1R0vCcCX3/ruT8p9xNRX44958rsao=
|
||||
github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw=
|
||||
github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ=
|
||||
github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U=
|
||||
github.com/gofiber/swagger v0.1.14 h1:o524wh4QaS4eKhUCpj7M0Qhn8hvtzcyxDsfZLXuQcRI=
|
||||
github.com/gofiber/swagger v0.1.14/go.mod h1:DCk1fUPsj+P07CKaZttBbV1WzTZSQcSxfub8y9/BFr8=
|
||||
github.com/gofiber/template v1.8.0 h1:jOn9RhxYO7rHTHGLNRpYfDoVm8b5GH/dtl15ZT5NifE=
|
||||
github.com/gofiber/template v1.8.0/go.mod h1:jf2w+ioGUS5swf5C/VK+FyE+DI19uz+vXHCX/TIAxIk=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
@ -225,6 +226,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
@ -251,8 +254,9 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||
@ -309,8 +313,10 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
|
||||
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
|
||||
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
|
||||
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
@ -327,6 +333,8 @@ github.com/ktr0731/go-ansisgr v0.1.0 h1:fbuupput8739hQbEmZn1cEKjqQFwtCCZNznnF6AN
|
||||
github.com/ktr0731/go-ansisgr v0.1.0/go.mod h1:G9lxwgBwH0iey0Dw5YQd7n6PmQTwTuTM/X5Sgm/UrzE=
|
||||
github.com/ktr0731/go-fuzzyfinder v0.7.0 h1:EqkCoqQh9Xpqet0PMAGSwgEnqLPXOSiRwIUMzhWQw2I=
|
||||
github.com/ktr0731/go-fuzzyfinder v0.7.0/go.mod h1:/5RXp7U9PRhvIrM86u/9TK0FjPbZQVT/NaplQO7CZmU=
|
||||
github.com/ktr0731/go-fuzzyfinder v0.8.0 h1:+yobwo9lqZZ7jd1URPdCgZXTE2U1mpIVTkQoo4roi6w=
|
||||
github.com/ktr0731/go-fuzzyfinder v0.8.0/go.mod h1:Bjpz5im+tppKE9Ii6UK1h+6RaX/lUvJ0ruO4LIYRkqo=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
|
||||
@ -351,8 +359,9 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
@ -429,8 +438,8 @@ github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY52
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4=
|
||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
||||
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
@ -455,8 +464,6 @@ github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw
|
||||
github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM=
|
||||
github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
|
||||
github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
|
||||
github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg=
|
||||
github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
|
||||
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||
@ -471,9 +478,9 @@ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/X
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
||||
github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
||||
github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M=
|
||||
github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
||||
github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA=
|
||||
github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g=
|
||||
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||
github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0=
|
||||
@ -551,8 +558,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
|
||||
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -601,8 +608,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
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/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -708,9 +715,9 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@ -718,8 +725,8 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -733,8 +740,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -798,8 +805,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
|
||||
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
||||
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
|
||||
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
15
pages/api.go
15
pages/api.go
@ -99,3 +99,18 @@ func HandleTranslate(c *fiber.Ctx) error {
|
||||
return c.JSON(data)
|
||||
}
|
||||
}
|
||||
|
||||
// HandleEngines godoc
|
||||
//
|
||||
// @Summary List engines
|
||||
// @Description Lists available Engines.
|
||||
// @Success 200 {object} map[string]string
|
||||
// @Router /api/engines [get]
|
||||
func HandleEngines(c *fiber.Ctx) error {
|
||||
engines := utils.EngineList()
|
||||
serializedData := make(map[string]interface{}, len(engines))
|
||||
for engineId, engineName := range engines {
|
||||
serializedData[engineId] = engineName
|
||||
}
|
||||
return c.JSON(serializedData)
|
||||
}
|
||||
|
@ -9,54 +9,6 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func envTrueNoExist(env string) bool {
|
||||
if _, ok := os.LookupEnv(env); ok == false || os.Getenv(env) == "true" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func engineList() map[string]string {
|
||||
engines := map[string]string{"all": "All Engines", "google": "Google", "deepl": "DeepL", "duckduckgo": "DuckDuckGo", "libre": "LibreTranslate", "mymemory": "MyMemory", "reverso": "Reverso", "watson": "Watson", "yandex": "Yandex"}
|
||||
if envTrueNoExist("MOZHI_GOOGLE_ENABLED") == false {
|
||||
delete(engines, "google")
|
||||
} else if envTrueNoExist("MOZHI_DEEPL_ENABLED") == false {
|
||||
delete(engines, "deepl")
|
||||
} else if envTrueNoExist("MOZHI_DUCKDUCKGO_ENABLED") == false {
|
||||
delete(engines, "duckduckgo")
|
||||
} else if envTrueNoExist("MOZHI_LIBRETRANSLATE_ENABLED") == false || envTrueNoExist("MOZHI_LIBRETRANSLATE_URL") {
|
||||
delete(engines, "libre")
|
||||
} else if envTrueNoExist("MOZHI_MYMEMORY_ENABLED") == false {
|
||||
delete(engines, "mymemory")
|
||||
} else if envTrueNoExist("MOZHI_REVERSO_ENABLED") == false {
|
||||
delete(engines, "reverso")
|
||||
} else if envTrueNoExist("MOZHI_WATSON_ENABLED") == false {
|
||||
delete(engines, "watson")
|
||||
} else if envTrueNoExist("MOZHI_YANDEX_ENABLED") == false {
|
||||
delete(engines, "yandex")
|
||||
}
|
||||
return engines
|
||||
}
|
||||
|
||||
// DeduplicateLists deduplicates a slice of List based on the Id field
|
||||
func deDuplicateLists(input []libmozhi.List) []libmozhi.List {
|
||||
// Create a map to store unique Ids
|
||||
uniqueIds := make(map[string]struct{})
|
||||
result := []libmozhi.List{}
|
||||
|
||||
// Iterate over the input slice
|
||||
for _, item := range input {
|
||||
// Check if the Id is unique
|
||||
if _, found := uniqueIds[item.Id]; !found {
|
||||
// Add the Id to the map and append the List to the result slice
|
||||
uniqueIds[item.Id] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func langListMerge(engines map[string]string) ([]libmozhi.List, []libmozhi.List) {
|
||||
sl := []libmozhi.List{}
|
||||
tl := []libmozhi.List{}
|
||||
@ -66,11 +18,11 @@ func langListMerge(engines map[string]string) ([]libmozhi.List, []libmozhi.List)
|
||||
sl = append(sl, temp...)
|
||||
tl = append(tl, temp2...)
|
||||
}
|
||||
return deDuplicateLists(sl), deDuplicateLists(tl)
|
||||
return utils.DeDuplicateLists(sl), utils.DeDuplicateLists(tl)
|
||||
}
|
||||
|
||||
func HandleIndex(c *fiber.Ctx) error {
|
||||
engines := engineList()
|
||||
engines := utils.EngineList()
|
||||
var enginesAsArray []string
|
||||
for engine := range engines {
|
||||
enginesAsArray = append(enginesAsArray, engine)
|
||||
@ -111,9 +63,8 @@ func HandleIndex(c *fiber.Ctx) error {
|
||||
translationExists = true
|
||||
}
|
||||
if engine == "google" || engine == "reverso" {
|
||||
if from == "auto" {
|
||||
//ttsFrom = "/api/tts?lang="+translation.AutoDetect+"&engine="+engine+"&text="+originalText
|
||||
ttsFrom = ""
|
||||
if from == "auto" && translation.AutoDetect != "" {
|
||||
ttsFrom = "/api/tts?lang=" + translation.AutoDetect + "&engine=" + engine + "&text=" + originalText
|
||||
} else {
|
||||
ttsFrom = "/api/tts?lang=" + from + "&engine=" + engine + "&text=" + originalText
|
||||
}
|
||||
@ -122,6 +73,15 @@ func HandleIndex(c *fiber.Ctx) error {
|
||||
} else {
|
||||
translationExists = false
|
||||
}
|
||||
|
||||
defaultLang := os.Getenv("MOZHI_DEFAULT_SOURCE_LANG")
|
||||
defaultLangTarget := os.Getenv("MOZHI_DEFAULT_TARGET_LANG")
|
||||
if defaultLang == "" {
|
||||
defaultLang = "auto"
|
||||
}
|
||||
if defaultLangTarget == "" {
|
||||
defaultLangTarget = "en"
|
||||
}
|
||||
return c.Render("index", fiber.Map{
|
||||
"Engine": engine,
|
||||
"enginesNames": engines,
|
||||
@ -135,6 +95,7 @@ func HandleIndex(c *fiber.Ctx) error {
|
||||
"To": to,
|
||||
"TtsFrom": ttsFrom,
|
||||
"TtsTo": ttsTo,
|
||||
"defaultLang": "en",
|
||||
"defaultLang": defaultLang,
|
||||
"defaultLangTarget": defaultLangTarget,
|
||||
})
|
||||
}
|
||||
|
@ -6,12 +6,14 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/aryak/libmozhi"
|
||||
_ "codeberg.org/aryak/mozhi/docs"
|
||||
"codeberg.org/aryak/mozhi/pages"
|
||||
"codeberg.org/aryak/mozhi/public"
|
||||
"codeberg.org/aryak/mozhi/views"
|
||||
"codeberg.org/aryak/mozhi/utils"
|
||||
"codeberg.org/aryak/mozhi/views"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/compress"
|
||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||
@ -36,9 +38,8 @@ func Serve(port string) {
|
||||
engine := html.NewFileSystem(views, ".html")
|
||||
|
||||
engine.AddFunc(
|
||||
// Add unescape function. This is needed to render HTML from Markdown.
|
||||
"unescape", func(s string) template.HTML {
|
||||
return template.HTML(s)
|
||||
"newlinetobr", func(s string) template.HTML {
|
||||
return template.HTML(strings.ReplaceAll(strings.ReplaceAll(s, "\n", "<br>"), "\r", ""))
|
||||
},
|
||||
)
|
||||
|
||||
@ -88,6 +89,7 @@ func Serve(port string) {
|
||||
api.All("/translate", pages.HandleTranslate)
|
||||
api.Get("/source_languages", pages.HandleSourceLanguages)
|
||||
api.Get("/target_languages", pages.HandleTargetLanguages)
|
||||
api.Get("/engines", pages.HandleEngines)
|
||||
api.Get("/tts", pages.HandleTTS)
|
||||
api.Get("/version", func(c *fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{
|
||||
@ -102,8 +104,17 @@ func Serve(port string) {
|
||||
engine := utils.Sanitize(utils.GetQueryOrFormValue(c, "engine"), "alpha")
|
||||
from := utils.Sanitize(utils.GetQueryOrFormValue(c, "from"), "alpha")
|
||||
to := utils.Sanitize(utils.GetQueryOrFormValue(c, "to"), "alpha")
|
||||
text := utils.Sanitize(utils.GetQueryOrFormValue(c, "text"), "alpha")
|
||||
return c.Redirect("/?engine="+engine+"&from="+to+"&to="+from+"&text="+text+"&redirected=true", 301)
|
||||
text := utils.GetQueryOrFormValue(c, "text")
|
||||
var swapText string
|
||||
if engine != "all" && text != "" {
|
||||
translation, tlerr := libmozhi.Translate(engine, to, from, text)
|
||||
if tlerr == nil {
|
||||
swapText = translation.OutputText
|
||||
} else {
|
||||
swapText = text
|
||||
}
|
||||
}
|
||||
return c.Redirect("/?engine="+engine+"&from="+to+"&to="+from+"&text="+swapText+"&redirected=true", 301)
|
||||
})
|
||||
app.Get("/about", pages.HandleAbout)
|
||||
app.Use("/", filesystem.New(filesystem.Config{
|
||||
|
@ -1,8 +1,10 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"codeberg.org/aryak/libmozhi"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"os"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
func GetQueryOrFormValue(c *fiber.Ctx, key string) string {
|
||||
@ -13,6 +15,13 @@ func GetQueryOrFormValue(c *fiber.Ctx, key string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func EnvTrueNoExist(env string) bool {
|
||||
if _, ok := os.LookupEnv(env); ok == false || os.Getenv(env) == "true" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func Sanitize(str string, strip string) string {
|
||||
nonAlphanumericRegex := regexp.MustCompile(`[^a-zA-Z]+`)
|
||||
nonAlphaRegex := regexp.MustCompile(`[^a-zA-Z0-9]+`)
|
||||
@ -23,3 +32,44 @@ func Sanitize(str string, strip string) string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func EngineList() map[string]string {
|
||||
engines := map[string]string{"all": "All Engines", "google": "Google", "deepl": "DeepL", "duckduckgo": "DuckDuckGo", "libre": "LibreTranslate", "mymemory": "MyMemory", "reverso": "Reverso", "watson": "Watson", "yandex": "Yandex"}
|
||||
if EnvTrueNoExist("MOZHI_GOOGLE_ENABLED") == false {
|
||||
delete(engines, "google")
|
||||
} else if EnvTrueNoExist("MOZHI_DEEPL_ENABLED") == false {
|
||||
delete(engines, "deepl")
|
||||
} else if EnvTrueNoExist("MOZHI_DUCKDUCKGO_ENABLED") == false {
|
||||
delete(engines, "duckduckgo")
|
||||
} else if EnvTrueNoExist("MOZHI_LIBRETRANSLATE_ENABLED") == false || EnvTrueNoExist("MOZHI_LIBRETRANSLATE_URL") {
|
||||
delete(engines, "libre")
|
||||
} else if EnvTrueNoExist("MOZHI_MYMEMORY_ENABLED") == false {
|
||||
delete(engines, "mymemory")
|
||||
} else if EnvTrueNoExist("MOZHI_REVERSO_ENABLED") == false {
|
||||
delete(engines, "reverso")
|
||||
} else if EnvTrueNoExist("MOZHI_WATSON_ENABLED") == false {
|
||||
delete(engines, "watson")
|
||||
} else if EnvTrueNoExist("MOZHI_YANDEX_ENABLED") == false {
|
||||
delete(engines, "yandex")
|
||||
}
|
||||
return engines
|
||||
}
|
||||
|
||||
// DeduplicateLists deduplicates a slice of List based on the Id field
|
||||
func DeDuplicateLists(input []libmozhi.List) []libmozhi.List {
|
||||
// Create a map to store unique Ids
|
||||
uniqueIds := make(map[string]struct{})
|
||||
result := []libmozhi.List{}
|
||||
|
||||
// Iterate over the input slice
|
||||
for _, item := range input {
|
||||
// Check if the Id is unique
|
||||
if _, found := uniqueIds[item.Id]; !found {
|
||||
// Add the Id to the map and append the List to the result slice
|
||||
uniqueIds[item.Id] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<!-- This hidden input is so that the engine gets sent in the request even though its not declared here -->
|
||||
<input name="engine" value="{{.Engine}}" type="hidden" />
|
||||
|
||||
<div class="wrap languages center-area" >
|
||||
<div class="wrap languages center-area">
|
||||
<div class="language">
|
||||
<select name="from" aria-label="Source language" id="sourceLanguage">
|
||||
{{range $key, $value := .SourceLanguages}} {{if $.From}}
|
||||
@ -46,24 +46,32 @@
|
||||
|
||||
<div class="language">
|
||||
<select name="to" aria-label="Target language" id="targetLanguage">
|
||||
{{range $key, $value := .TargetLanguages}}
|
||||
{{range $key, $value := .TargetLanguages}} {{if $.To}}
|
||||
<option value="{{ .Id }}" {{if eq $.To .Id}}selected{{end}}>
|
||||
{{ .Name }}
|
||||
</option>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<option value="{{ .Id }}" {{if eq .Id $.defaultLangTarget}}selected{{end}}>
|
||||
{{ .Name }}
|
||||
</option>
|
||||
{{end}} {{end}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="center-area2 item-wrapper">
|
||||
Source Text:
|
||||
<div class="center-area2 item-wrapper">
|
||||
Source Text:
|
||||
<textarea autofocus class="item" id="input" name="text" dir="auto" placeholder="Enter Text Here">
|
||||
{{ .OriginalText }}</textarea>
|
||||
{{if .Translation.SourceTransliteration}}
|
||||
<br>Transliteration: {{newlinetobr .Translation.SourceTransliteration}}{{end}}
|
||||
{{if .TtsFrom}}
|
||||
<br>
|
||||
<audio class="mx-auto" controls>
|
||||
<source type="audio/mpeg" src="{{ .TtsFrom }}" />
|
||||
</audio>
|
||||
{{end}}
|
||||
<br>
|
||||
</div>
|
||||
|
||||
{{ if .TranslateAll }}
|
||||
@ -73,11 +81,16 @@
|
||||
<textarea class="translation item" dir="auto" placeholder="Translation" id="output" readonly>
|
||||
{{.OutputText}}</textarea>
|
||||
{{if .AutoDetect}}
|
||||
Detected Language: {{.AutoDetect}}{{end}} {{if $.TtsTo}}
|
||||
<br>Detected Language: {{.AutoDetect}}{{end}}
|
||||
{{if .Translation.TargetTransliteration}}
|
||||
<br>Transliteration: {{newlinetobr .Translation.TargetTransliteration}}{{end}}
|
||||
{{if $.TtsTo}}
|
||||
<br>
|
||||
<audio class="mx-auto" controls>
|
||||
<source type="audio/mpeg" src="{{ $.TtsTo }}" />
|
||||
</audio>
|
||||
{{end}}
|
||||
<br>
|
||||
</div>
|
||||
{{end}}
|
||||
{{ else }} {{if .TranslationExists}}
|
||||
@ -85,11 +98,16 @@
|
||||
<textarea class="translation item" dir="auto" placeholder="Translation" id="output" readonly>
|
||||
{{.Translation.OutputText}}</textarea>
|
||||
{{if .Translation.AutoDetect}}
|
||||
Detected Language: {{.Translation.AutoDetect}}{{end}} {{if .TtsTo}}
|
||||
<br>Detected Language: {{.Translation.AutoDetect}}{{end}}
|
||||
{{if .Translation.TargetTransliteration}}
|
||||
<br>Transliteration: {{newlinetobr .Translation.TargetTransliteration}}{{end}}
|
||||
{{if .TtsTo}}
|
||||
<br>
|
||||
<audio class="mx-auto" controls>
|
||||
<source class="mx-auto" type="audio/mpeg" src="{{ .TtsTo }}" />
|
||||
<source type="audio/mpeg" src="{{ .TtsTo }}" />
|
||||
</audio>
|
||||
{{end}}
|
||||
<br>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .TranslationExists}}
|
||||
|
Loading…
Reference in New Issue
Block a user