Compare commits
1 Commits
bootstrap/
...
config/v0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f65e647380 |
@@ -1,32 +1,32 @@
|
||||
package polaris
|
||||
|
||||
import (
|
||||
polarisKratos "github.com/go-kratos/kratos/contrib/config/polaris/v2"
|
||||
//polarisKratos "github.com/go-kratos/kratos/contrib/config/polaris/v2"
|
||||
"github.com/go-kratos/kratos/v2/config"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
polarisApi "github.com/polarismesh/polaris-go"
|
||||
//"github.com/go-kratos/kratos/v2/log"
|
||||
//
|
||||
//polarisApi "github.com/polarismesh/polaris-go"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewConfigSource 创建一个远程配置源 - Polaris
|
||||
func NewConfigSource(_ *conf.RemoteConfig) config.Source {
|
||||
configApi, err := polarisApi.NewConfigAPI()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var opts []polarisKratos.Option
|
||||
opts = append(opts, polarisKratos.WithNamespace("default"))
|
||||
opts = append(opts, polarisKratos.WithFileGroup("default"))
|
||||
opts = append(opts, polarisKratos.WithFileName("default.yaml"))
|
||||
|
||||
source, err := polarisKratos.New(configApi, opts...)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return source
|
||||
//configApi, err := polarisApi.NewConfigAPI()
|
||||
//if err != nil {
|
||||
// log.Fatal(err)
|
||||
//}
|
||||
//
|
||||
//var opts []polarisKratos.Option
|
||||
//opts = append(opts, polarisKratos.WithNamespace("default"))
|
||||
//opts = append(opts, polarisKratos.WithFileGroup("default"))
|
||||
//opts = append(opts, polarisKratos.WithFileName("default.yaml"))
|
||||
//
|
||||
//source, err := polarisKratos.New(configApi, opts...)
|
||||
//if err != nil {
|
||||
// log.Fatal(err)
|
||||
//}
|
||||
//
|
||||
//return source
|
||||
return nil
|
||||
}
|
||||
|
||||
2
tag.bat
2
tag.bat
@@ -5,7 +5,7 @@ git tag utils/v0.1.0 --force
|
||||
git tag cache/redis/v0.0.5 --force
|
||||
git tag oss/minio/v0.0.5 --force
|
||||
git tag registry/v0.0.7 --force
|
||||
git tag config/v0.0.6 --force
|
||||
git tag config/v0.0.7 --force
|
||||
git tag logger/v0.0.7 --force
|
||||
git tag rpc/v0.0.5 --force
|
||||
git tag tracer/v0.0.5 --force
|
||||
|
||||
Reference in New Issue
Block a user