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.
 
 
 
 
kratos/contrib/config/polaris
包子 a672980a15
fix: upgrade go.sum (#2715)
2 years ago
..
README.md style(contrib/config): code style modify (#2475) 2 years ago
config.go style(contrib/config): code style modify (#2475) 2 years ago
go.mod fix: upgrade go.sum (#2715) 2 years ago
go.sum build(deps): bump golang.org/x/net in /contrib/config/polaris (#2706) 2 years ago
polaris.yaml feat: add contrib/config/polaris polaris as configcenter (#2158) 2 years ago
watcher.go style(contrib/config): code style modify (#2475) 2 years ago

README.md

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()
}