diff --git a/connector-apache/go.mod b/connector-apache/go.mod index e635bce4..4705ad63 100644 --- a/connector-apache/go.mod +++ b/connector-apache/go.mod @@ -6,6 +6,7 @@ require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/connector-apache/util.go b/connector-apache/util.go new file mode 100644 index 00000000..b1208475 --- /dev/null +++ b/connector-apache/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package apache + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/connector-basic/go.mod b/connector-basic/go.mod index c12730e9..a6e39a28 100644 --- a/connector-basic/go.mod +++ b/connector-basic/go.mod @@ -8,6 +8,7 @@ require ( github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f github.com/tidwall/gjson v1.14.4 golang.org/x/oauth2 v0.4.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/connector-basic/util.go b/connector-basic/util.go new file mode 100644 index 00000000..bc94b414 --- /dev/null +++ b/connector-basic/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package basic + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/connector-dingtalk/go.mod b/connector-dingtalk/go.mod index 33bac192..c45907be 100644 --- a/connector-dingtalk/go.mod +++ b/connector-dingtalk/go.mod @@ -6,6 +6,7 @@ require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/connector-dingtalk/util.go b/connector-dingtalk/util.go new file mode 100644 index 00000000..6dd0d975 --- /dev/null +++ b/connector-dingtalk/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package dingtalk + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/connector-github/go.mod b/connector-github/go.mod index d96b5cd5..cf4892a5 100644 --- a/connector-github/go.mod +++ b/connector-github/go.mod @@ -8,6 +8,7 @@ require ( 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 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/connector-github/util.go b/connector-github/util.go new file mode 100644 index 00000000..cd2b9a29 --- /dev/null +++ b/connector-github/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package github + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/connector-google/go.mod b/connector-google/go.mod index d9aa60f3..7e88403c 100644 --- a/connector-google/go.mod +++ b/connector-google/go.mod @@ -6,6 +6,7 @@ require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 golang.org/x/oauth2 v0.4.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/connector-google/util.go b/connector-google/util.go new file mode 100644 index 00000000..e0d1a794 --- /dev/null +++ b/connector-google/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package google + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/editor-chart/go.sum b/editor-chart/go.sum index 38232d4b..85492e50 100644 --- a/editor-chart/go.sum +++ b/editor-chart/go.sum @@ -23,7 +23,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= @@ -48,7 +47,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= @@ -67,7 +65,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= @@ -83,7 +80,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= @@ -134,7 +130,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= diff --git a/editor-chart/util.go b/editor-chart/util.go new file mode 100644 index 00000000..a72cd4df --- /dev/null +++ b/editor-chart/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package chart + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/editor-formula/go.sum b/editor-formula/go.sum index 38232d4b..85492e50 100644 --- a/editor-formula/go.sum +++ b/editor-formula/go.sum @@ -23,7 +23,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= @@ -48,7 +47,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= @@ -67,7 +65,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= @@ -83,7 +80,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= @@ -134,7 +130,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= diff --git a/editor-formula/util.go b/editor-formula/util.go new file mode 100644 index 00000000..fb3b23f3 --- /dev/null +++ b/editor-formula/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package formula + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/embed-basic/util.go b/embed-basic/util.go new file mode 100644 index 00000000..1423319c --- /dev/null +++ b/embed-basic/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package embed_basic + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/notification-slack/go.mod b/notification-slack/go.mod index 9e4cf5c2..b84c3089 100644 --- a/notification-slack/go.mod +++ b/notification-slack/go.mod @@ -7,6 +7,7 @@ require ( github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/go-resty/resty/v2 v2.11.0 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/notification-slack/util.go b/notification-slack/util.go new file mode 100644 index 00000000..f6ad858a --- /dev/null +++ b/notification-slack/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package slack + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/reviewer-akismet/go.mod b/reviewer-akismet/go.mod index c38e3974..b9630300 100644 --- a/reviewer-akismet/go.mod +++ b/reviewer-akismet/go.mod @@ -7,6 +7,7 @@ require ( github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/go-resty/resty/v2 v2.12.0 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/reviewer-akismet/util.go b/reviewer-akismet/util.go new file mode 100644 index 00000000..bc94b414 --- /dev/null +++ b/reviewer-akismet/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package basic + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/reviewer-basic/go.mod b/reviewer-basic/go.mod index ca71067c..ed81ca40 100644 --- a/reviewer-basic/go.mod +++ b/reviewer-basic/go.mod @@ -6,6 +6,7 @@ require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/reviewer-basic/util.go b/reviewer-basic/util.go new file mode 100644 index 00000000..bc94b414 --- /dev/null +++ b/reviewer-basic/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package basic + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/search-algolia/go.mod b/search-algolia/go.mod index f565b263..3d0c52c1 100644 --- a/search-algolia/go.mod +++ b/search-algolia/go.mod @@ -7,6 +7,7 @@ require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/search-algolia/util.go b/search-algolia/util.go new file mode 100644 index 00000000..aa974024 --- /dev/null +++ b/search-algolia/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package algolia + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/search-elasticsearch/go.mod b/search-elasticsearch/go.mod index 9715c320..3b951ae0 100644 --- a/search-elasticsearch/go.mod +++ b/search-elasticsearch/go.mod @@ -7,6 +7,7 @@ require ( github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/olivere/elastic/v7 v7.0.32 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/search-elasticsearch/util.go b/search-elasticsearch/util.go new file mode 100644 index 00000000..23fc2028 --- /dev/null +++ b/search-elasticsearch/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package es + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/search-meilisearch/util.go b/search-meilisearch/util.go new file mode 100644 index 00000000..881a139a --- /dev/null +++ b/search-meilisearch/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package meilisearch + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/storage-aliyunoss/util.go b/storage-aliyunoss/util.go new file mode 100644 index 00000000..bbb04de5 --- /dev/null +++ b/storage-aliyunoss/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package aliyunoss + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/storage-s3/util.go b/storage-s3/util.go new file mode 100644 index 00000000..317929a8 --- /dev/null +++ b/storage-s3/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package s3 + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +} diff --git a/user-center-wecom/go.mod b/user-center-wecom/go.mod index 06f65fac..7a49e989 100644 --- a/user-center-wecom/go.mod +++ b/user-center-wecom/go.mod @@ -11,6 +11,7 @@ require ( github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f github.com/silenceper/wechat/v2 v2.1.6 github.com/tidwall/gjson v1.14.4 + gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/user-center-wecom/util.go b/user-center-wecom/util.go new file mode 100644 index 00000000..866016b5 --- /dev/null +++ b/user-center-wecom/util.go @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package wecom + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + + "gopkg.in/yaml.v2" +) + +type Info struct { + SlugName string `yaml:"slug_name"` + Type string `yaml:"type"` + Version string `yaml:"version"` + Author string `yaml:"author"` + Link string `yaml:"link"` +} + +func (c *Info) getInfo() *Info { + _, filename, _, _ := runtime.Caller(0) + wd := filepath.Dir(filename) + + yamlFilePath := filepath.Join(wd, "info.yaml") + yamlFile, err := os.ReadFile(yamlFilePath) + if err != nil { + fmt.Println(err) + } + err = yaml.Unmarshal(yamlFile, c) + if err != nil { + fmt.Println(err) + } + return c +}