nacosstarter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigClient

func GetConfigClient(group string) (*configClient, error)

func GetNamingClient

func GetNamingClient(group string) (*namingClient, error)

func RawConfigInstance

func RawConfigInstance() config_client.IConfigClient

func RawNamingInstance

func RawNamingInstance() naming_client.INamingClient

Types

type ConfigChangeListener

type ConfigChangeListener func(namespace, group, dataId, data string)

ConfigChangeListener 文件变动监听回调

type ConfigFileSetting

type ConfigFileSetting struct {
	DataId string
	Type   ConfigType
	Watch  bool
	Value  any
}

type ConfigType

type ConfigType string
const (
	ConfigTypeJson ConfigType = "json"
	ConfigTypeYaml ConfigType = "yaml"
)

type InitConfigSettings

type InitConfigSettings struct {
	ConfigSetting []*ConfigFileSetting
	GroupName     string
}

type NacosClientConfig

type NacosClientConfig struct {
	*constant.ClientConfig
}

type NacosServerConfig

type NacosServerConfig struct {
	Services []constant.ServerConfig
}

type NacosStarter

type NacosStarter struct {

	// nacos组件模块设置
	GrpcModuleConfig *parent.Setting

	ServerConfig *NacosServerConfig
	ClientConfig *NacosClientConfig

	// 禁用配置功能
	DisableConfig bool
	// 禁用服务发现功能
	DisableDiscovery bool

	// 需要立即初始化的配置
	// 该设置将在nacos就绪后立即执行,适用于初始化配置其他模块可以立即在后续读取
	InitConfigSettings *InitConfigSettings
}

func (*NacosStarter) Setting

func (n *NacosStarter) Setting() *parent.Setting

func (*NacosStarter) Start

func (n *NacosStarter) Start() (interface{}, error)

func (*NacosStarter) Stop

func (n *NacosStarter) Stop(maxWaitTime time.Duration) (gracefully, stopped bool, err error)

type ServiceInstance

type ServiceInstance struct {
	Instance           *model.Instance
	InstanceIdentifier string
}

Jump to

Keyboard shortcuts

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