Skip to content

Commit

Permalink
fix(util): change info.yaml with go:embed
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Jul 16, 2024
1 parent 967ca03 commit 46c0511
Show file tree
Hide file tree
Showing 61 changed files with 162 additions and 89 deletions.
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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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 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
2 changes: 1 addition & 1 deletion connector-apache/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
)

Expand Down
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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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
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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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
6 changes: 5 additions & 1 deletion connector-dingtalk/dingtalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package dingtalk

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

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

const (
LogoSVG = "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCI+PHBhdGggZmlsbD0iIzAwODlmZiIgZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDhzNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0bTIyNyAzODUuM2MtMSA0LjItMy41IDEwLjQtNyAxNy44aC4xbC0uNC43Yy0yMC4zIDQzLjEtNzMuMSAxMjcuNy03My4xIDEyNy43cy0uMS0uMi0uMy0uNWwtMTUuNSAyNi44aDc0LjVMNTc1LjEgODEwbDMyLjMtMTI4aC01OC42bDIwLjQtODQuN2MtMTYuNSAzLjktMzUuOSA5LjQtNTkgMTYuOGMwIDAtMzEuMiAxOC4yLTg5LjktMzVjMCAwLTM5LjYtMzQuNy0xNi42LTQzLjRjOS44LTMuNyA0Ny40LTguNCA3Ny0xMi4zYzQwLTUuNCA2NC42LTguMiA2NC42LTguMlM0MjIgNTE3IDM5Mi43IDUxMi41Yy0yOS4zLTQuNi02Ni40LTUzLjEtNzQuMy05NS44YzAgMC0xMi4yLTIzLjQgMjYuMy0xMi4zYzM4LjUgMTEuMSAxOTcuOSA0My4yIDE5Ny45IDQzLjJzLTIwNy40LTYzLjMtMjIxLjItNzguN2MtMTMuOC0xNS40LTQwLjYtODQuMi0zNy4xLTEyNi41YzAgMCAxLjUtMTAuNSAxMi40LTcuN2MwIDAgMTUzLjMgNjkuNyAyNTguMSAxMDcuOWMxMDQuOCAzNy45IDE5NS45IDU3LjMgMTg0LjIgMTA2LjciLz48L3N2Zz4="
AuthorizeURL = "https://login.dingtalk.com/oauth2/auth"
Expand Down Expand Up @@ -72,7 +76,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-dingtalk/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
)

Expand Down
4 changes: 2 additions & 2 deletions connector-dingtalk/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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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 connector-github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package github

import (
"context"
"embed"
"encoding/json"
"fmt"
"github.com/apache/incubator-answer-plugins/util"
Expand All @@ -34,6 +35,9 @@ import (
oauth2GitHub "golang.org/x/oauth2/github"
)

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

type Connector struct {
Config *ConnectorConfig
}
Expand All @@ -51,7 +55,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-github/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
github.com/google/go-github/v50 v50.1.0
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
golang.org/x/oauth2 v0.4.0
Expand Down
4 changes: 2 additions & 2 deletions connector-github/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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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-google/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 v1.0.0
github.com/apache/incubator-answer-plugins/util v1.0.1
golang.org/x/oauth2 v0.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions connector-google/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,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 v1.0.0 h1:Wr5N72iUt2bkzIZ+EVoi/1CFw0xNjc19lwx9V01yzbY=
github.com/apache/incubator-answer-plugins/util v1.0.0/go.mod h1:KPMSiM4ec4uEl2njaGINYuSl6zVmHdvPB2nHUxVcQDo=
github.com/apache/incubator-answer-plugins/util v1.0.1 h1:8KYYuQL6aILlbMif0+EtR6rT9ftYRUt502VjyCHpT+4=
github.com/apache/incubator-answer-plugins/util v1.0.1/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 connector-google/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package google

import (
"context"
"embed"
"encoding/json"
"fmt"
"github.com/apache/incubator-answer-plugins/util"
Expand All @@ -33,6 +34,9 @@ import (
oauth2Google "golang.org/x/oauth2/google"
)

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

type Connector struct {
Config *ConnectorConfig
}
Expand Down Expand Up @@ -62,7 +66,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
6 changes: 5 additions & 1 deletion editor-chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
package chart

import (
"embed"
"github.com/apache/incubator-answer-plugins/editor-chart/i18n"
"github.com/apache/incubator-answer-plugins/util"
"github.com/apache/incubator-answer/plugin"
)

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

type ChartPlugin struct {
}

Expand All @@ -34,7 +38,7 @@ func init() {

func (d ChartPlugin) Info() plugin.Info {
info := &util.Info{}
info.GetInfo()
info.GetInfo(Info)

return plugin.Info{
Name: plugin.MakeTranslator(i18n.InfoName),
Expand Down
Loading

0 comments on commit 46c0511

Please sign in to comment.