You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
410 B
26 lines
410 B
2 years ago
|
# Polaris Config
|
||
|
|
||
|
```go
|
||
|
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()
|
||
|
}
|
||
|
```
|