1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-14 02:33:03 +02:00
kratos/contrib/config/polaris
rogerogers 6c36cc9544
feat: add contrib/config/polaris polaris as configcenter (#2158)
* feat(contrib): add contrib/config/polaris polaris as configcenter

* style(contrib): import style change

Co-authored-by: sense <rogers@hibobi.com>
2022-07-06 21:04:32 +08:00
..
config_test.go feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
config.go feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
go.mod feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
go.sum feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
polaris.yaml feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
README.md feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00
watcher.go feat: add contrib/config/polaris polaris as configcenter (#2158) 2022-07-06 21:04:32 +08:00

Polaris Config

import (
 "log"

 "github.com/polarismesh/polaris-go"
 "github.com/go-kratos/kratos/contrib/config/polaris/v2"
)

func main() {

 configApi, err := polaris.NewConfigAPI()
 if err != nil {
  log.Fatalln(err)
 }

 source, err := New(&configApi, WithNamespace("default"), WithFileGroup("default"), WithFileName("default.yaml"))

 if err != nil {
  log.Fatalln(err)
 }
 source.Load()
}