Skip to content

Commit

Permalink
refactor(cdn-oss): Merge branch 'main' into feat/cdn/oss
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Jul 17, 2024
2 parents 6734872 + 2b935cd commit ab64ede
Show file tree
Hide file tree
Showing 85 changed files with 442 additions and 151 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/sync-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install jq
run: sudo apt-get install jq
uses: actions/checkout@v4

- name: Run script
run: script/sync-info.sh
Expand All @@ -39,10 +36,10 @@ jobs:
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: Sync version"
title: "chore: Sync version"
body: "Sync version"
branch: "chore/sync-package-version"
commit-message: "chore: Sync Plugin Info"
title: "chore: Sync Plugin Info"
body: "Sync Plugin Info"
branch: "chore/sync-info"
base: "main"


2 changes: 1 addition & 1 deletion cache-redis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/go-redis/redis/v8 v8.11.5
)

Expand Down
4 changes: 2 additions & 2 deletions cache-redis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2Q
github.com/LinkinStars/go-i18n/v2 v2.2.2/go.mod h1:hLglSJ4/3M0Y7ZVcoEJI+OwqkglHCA32DdjuJJR2LbM=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe h1:qjPRGlo6u24SQJDKqGpLNz2ju/BuTH4FO5Xy5RPXZC0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b h1:gtNx+jOpOaFbv5CZ0pVm69MDazqLbFkyl3LNpZHKJHQ=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand Down
6 changes: 5 additions & 1 deletion cache-redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ package redis

import (
"context"
"embed"
_ "embed"
"encoding/json"
"fmt"
"github.com/apache/incubator-answer-plugins/util"
Expand All @@ -34,6 +36,8 @@ import (

var (
configuredErr = fmt.Errorf("redis is not configured correctly")
//go:embed info.yaml
Info embed.FS
)

type Cache struct {
Expand All @@ -55,7 +59,7 @@ func init() {

func (c *Cache) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
6 changes: 5 additions & 1 deletion captcha-basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package basic

import (
"embed"
"github.com/apache/incubator-answer-plugins/util"
"image/color"

Expand All @@ -28,6 +29,9 @@ import (
"github.com/mojocn/base64Captcha"
)

//go:embed info.yaml
var Info embed.FS

type Captcha struct {
}

Expand All @@ -37,7 +41,7 @@ func init() {

func (c *Captcha) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
2 changes: 1 addition & 1 deletion captcha-basic/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/mojocn/base64Captcha v1.3.6
)

Expand Down
4 changes: 2 additions & 2 deletions captcha-basic/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2Q
github.com/LinkinStars/go-i18n/v2 v2.2.2/go.mod h1:hLglSJ4/3M0Y7ZVcoEJI+OwqkglHCA32DdjuJJR2LbM=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe h1:qjPRGlo6u24SQJDKqGpLNz2ju/BuTH4FO5Xy5RPXZC0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b h1:gtNx+jOpOaFbv5CZ0pVm69MDazqLbFkyl3LNpZHKJHQ=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand Down
2 changes: 1 addition & 1 deletion captcha-google-v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
)

Expand Down
4 changes: 2 additions & 2 deletions captcha-google-v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2Q
github.com/LinkinStars/go-i18n/v2 v2.2.2/go.mod h1:hLglSJ4/3M0Y7ZVcoEJI+OwqkglHCA32DdjuJJR2LbM=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe h1:qjPRGlo6u24SQJDKqGpLNz2ju/BuTH4FO5Xy5RPXZC0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b h1:gtNx+jOpOaFbv5CZ0pVm69MDazqLbFkyl3LNpZHKJHQ=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand Down
6 changes: 5 additions & 1 deletion captcha-google-v2/recaptcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package recaptcha

import (
"embed"
"github.com/apache/incubator-answer-plugins/util"
"io"
"net/http"
Expand All @@ -33,6 +34,9 @@ import (
"github.com/segmentfault/pacman/log"
)

//go:embed info.yaml
var Info embed.FS

type Captcha struct {
Config *CaptchaConfig
}
Expand All @@ -55,7 +59,7 @@ func init() {

func (c *Captcha) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
6 changes: 5 additions & 1 deletion cdn-aliyunoss/aliyunoss.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package aliyunoss

import (
"embed"
"encoding/json"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/apache/incubator-answer-plugins/cdn-aliyunoss/i18n"
Expand All @@ -36,6 +37,9 @@ import (

var staticPath = os.Getenv("ANSWER_STATIC_PATH")

//go:embed info.yaml
var Info embed.FS

const (
// 10MB
defaultMaxFileSize int64 = 10 * 1024 * 1024
Expand Down Expand Up @@ -82,7 +86,7 @@ func init() {

func (c *CDN) Info() plugin.Info {
info := util.Info{}
info.GetInfo()
info.GetInfo(Info)
return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
SlugName: info.SlugName,
Expand Down
4 changes: 2 additions & 2 deletions cdn-aliyunoss/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.19

require (
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/apache/incubator-answer v1.3.6
github.com/apache/incubator-answer-plugins/util v0.0.0-20240712061634-0eab52b019e6
github.com/apache/incubator-answer v1.3.5
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
)

Expand Down
11 changes: 4 additions & 7 deletions cdn-aliyunoss/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2Q
github.com/LinkinStars/go-i18n/v2 v2.2.2/go.mod h1:hLglSJ4/3M0Y7ZVcoEJI+OwqkglHCA32DdjuJJR2LbM=
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g=
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240712061634-0eab52b019e6 h1:6Sld5x3mxGV0sDE8IyuyqwRC8z6DlMBNDQQgjbY7n9M=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240712061634-0eab52b019e6/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer v1.3.5 h1:vTsm54JUUK2xqZPni0gkv6PYupc03UZSYdIVGO1IOrI=
github.com/apache/incubator-answer v1.3.5/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand All @@ -25,7 +27,6 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
Expand All @@ -50,7 +51,6 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
Expand All @@ -69,7 +69,6 @@ github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNc
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f h1:9f2Bjf6bdMvNyUop32wAGJCdp+Jdm/d6nKBYvFvkRo0=
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f/go.mod h1:5lNp5REd8QMThmBUvR3Fi9Y3AsOB4GRq7soCB4QLqOs=
github.com/segmentfault/pacman/contrib/i18n v0.0.0-20230516093754-b76aef1c1150 h1:OEuW1D7RGDE0CZDr0oGMw9Eiq7fAbD9C4WMrvSixamk=
Expand All @@ -85,7 +84,6 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
Expand Down Expand Up @@ -138,7 +136,6 @@ google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cn
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Expand Down
6 changes: 5 additions & 1 deletion connector-apache/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package apache

import (
"embed"
"encoding/json"
"fmt"
"github.com/apache/incubator-answer-plugins/util"
Expand All @@ -32,6 +33,9 @@ import (
"github.com/segmentfault/pacman/log"
)

//go:embed info.yaml
var Info embed.FS

type Connector struct {
}

Expand All @@ -41,7 +45,7 @@ func init() {

func (g *Connector) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
4 changes: 2 additions & 2 deletions connector-apache/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ go 1.19

require (
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
gopkg.in/yaml.v2 v2.4.0
)

require (
Expand Down Expand Up @@ -43,6 +42,7 @@ require (
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
4 changes: 2 additions & 2 deletions connector-apache/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2Q
github.com/LinkinStars/go-i18n/v2 v2.2.2/go.mod h1:hLglSJ4/3M0Y7ZVcoEJI+OwqkglHCA32DdjuJJR2LbM=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe h1:qjPRGlo6u24SQJDKqGpLNz2ju/BuTH4FO5Xy5RPXZC0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b h1:gtNx+jOpOaFbv5CZ0pVm69MDazqLbFkyl3LNpZHKJHQ=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand Down
2 changes: 1 addition & 1 deletion connector-apache/info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ slug_name: apache_connector
type: connector
version: 1.0.0
author: answerdev
link: https://apache.com/apache/incubator-answer-plugins/tree/main/connector-apache
link: https://github.com/apache/incubator-answer-plugins/tree/main/connector-apache
5 changes: 4 additions & 1 deletion connector-basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package basic

import (
"context"
"embed"
"encoding/json"
"fmt"
"github.com/apache/incubator-answer-plugins/util"
Expand All @@ -40,6 +41,8 @@ import (

var (
replaceUsernameReg = regexp.MustCompile(`[^a-zA-Z0-9._-]+`)
//go:embed info.yaml
Info embed.FS
)

type Connector struct {
Expand Down Expand Up @@ -76,7 +79,7 @@ func init() {

func (g *Connector) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
2 changes: 1 addition & 1 deletion connector-basic/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b
github.com/apache/incubator-answer-plugins/util v1.0.2
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
github.com/tidwall/gjson v1.14.4
golang.org/x/oauth2 v0.4.0
Expand Down
4 changes: 2 additions & 2 deletions connector-basic/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe h1:qjPRGlo6u24SQJDKqGpLNz2ju/BuTH4FO5Xy5RPXZC0=
github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe/go.mod h1:YKwpG0rwRC0kHcbILcIyIbPMwsWaZ8j5lHJ34DPIdMI=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b h1:gtNx+jOpOaFbv5CZ0pVm69MDazqLbFkyl3LNpZHKJHQ=
github.com/apache/incubator-answer-plugins/util v0.0.0-20240710062621-38f880f8866b/go.mod h1:dq/SmyUtl98iV85NswmBGmi2jdc/1dOMDzWD2JGBA0o=
github.com/apache/incubator-answer-plugins/util v1.0.2 h1:PontocVaiEm+oTj+4aDonwWDZnxywUeHsaTwlQgclfA=
github.com/apache/incubator-answer-plugins/util v1.0.2/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
Expand Down
2 changes: 1 addition & 1 deletion connector-basic/info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ slug_name: basic_connector
type: connector
version: 1.2.5
author: answerdev
link: https://apache.com/apache/incubator-answer-plugins/tree/main/connector-basic
link: https://github.com/apache/incubator-answer-plugins/tree/main/connector-basic
Loading

0 comments on commit ab64ede

Please sign in to comment.