Nacos-sdk-go is a streamlined Nacos client created with Golang that incorporates permission management features.
- Configuration Management
- Service Discover
- Namespace
- Permisstion Management
- User Management
- Role Management
- Permisstions Management
nacos-client supports 2 last Go versions and requires a Go version with modules support. So make sure to initialize a Go module:
go mod init github.com/my/repo
Then install nacos-client:
go get github.com/1ch0/nacos-client
import (
nacos "github.com/1ch0/nacos-sdk-go"
)
func ExampleClient() {
client := nacos.New(
&nacos.Config{
Addr: "http://locahost:8848",
Username: "nacos",
Password: "nacos",
})
if err := client.Health(); err != nil {
panic(err)
}
if err := client.Login(); err != nil {
panic(err)
}
}