Skip to content

v0.0.2

Choose a tag to compare

@LanceAdd LanceAdd released this 12 Aug 02:03
· 7 commits to main since this release

nacos-gf

install

go get -u -v github.com/LanceAdd/nacos-gf latest

config.yaml

nacos:
  cloud:
    config: true
    registry: true
  config:
    ip: "127.0.0.1"
    port: 8848
    nameSpaceId: "public"
    group: "default"
    dataId: "config.yaml"
    username: "nacos"
    password: "nacos"
  registry:
    ip: "127.0.0.1"
    port: 8848
    nameSpaceId: "public"
    group: "default"
    username: "nacos"
    password: "nacos"

Usage

package boot

import (
	"github.com/LanceAdd/nacos-gf"
)

func init() {
	// The parameters of LoadRemoteConfig are custom functions that are used to perform some custom operations after the remote configuration file is updated

	nacos.LoadRemoteConfig(ReInitAuth, ReInitSecurity, ReInitSnapShot)
	nacos.LoadRegisterConfig()
}