nacos

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package nacos implements onexmesh registry.Registrar and registry.Discovery backed by the Nacos service discovery (github.com/nacos-group/nacos-sdk-go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(opts Options) (registry.Discovery, error)

NewDiscovery creates a Nacos Discovery.

func NewRegistrar

func NewRegistrar(opts Options) (registry.Registrar, error)

NewRegistrar creates a Nacos Registrar.

Types

type Options

type Options struct {
	// Addr is the Nacos server address, e.g. "127.0.0.1:8848".
	Addr string
	// ContextPath is the Nacos server context path, e.g. "/nacos".
	ContextPath string
	// NamespaceID is the Nacos namespace ID. Empty means the public namespace.
	NamespaceID string
	// GroupName is the service group name. Default "DEFAULT_GROUP".
	GroupName string
	// ClusterName is the service cluster name. Default "DEFAULT".
	ClusterName string
	// Username and Password enable Nacos auth when set.
	Username string
	Password string
	// Host is the local instance host used for registration.
	Host string
	// Port is the local instance port used for registration.
	Port int
	// Weight is the instance weight. Default 100.
	Weight float64
	// Protocol is the service protocol, e.g. "grpc" or "http".
	Protocol string
}

Options configures the Nacos backend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL