NacosUtils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigContentByConfigFile added in v0.0.2

func GetConfigContentByConfigFile(nacosConfigFile string) (string, error)

GetConfigContentByConfigFile 获取nacos配置文件内容

func GetConfigContentByNacosConfig added in v0.0.2

func GetConfigContentByNacosConfig(nacosConfig NacosConfig) (string, error)

GetConfigContentByNacosConfig 根据nacos配置获取配置文件内容

func GetNacosClient added in v0.0.2

func GetNacosClient(nacosConfig NacosConfig) (config_client.IConfigClient, error)

GetNacosClient 获取nacos配置客户端

func GetNacosClientConfig

func GetNacosClientConfig(nacosConfig NacosConfig) *constant.ClientConfig

GetNacosClientConfig 获取nacos客户端配置

func GetServerConfig

func GetServerConfig(nacosConfig NacosConfig) []constant.ServerConfig

GetServerConfig 获取nacos服务配置

func ListenConfigContentByConfigFile added in v0.0.2

func ListenConfigContentByConfigFile(nacosConfigFile *string)

ListenConfigContentByConfigFile TODO: 想想之后怎么实现 1.配置变化后,热重启或者重新加载配置 ListenConfigContentByConfigFile 监听nacos配置文件

Types

type NacosConfig

type NacosConfig struct {
	ConfigParam NacosConfigParam
}

func GetNacosConfig

func GetNacosConfig(nacosConfigFile string) (NacosConfig, error)

GetNacosConfig 从配置文件中获取nacos配置

type NacosConfigParam

type NacosConfigParam struct {
	Host         string
	Port         uint64
	DataId       string
	Group        string
	ClientConfig constant.ClientConfig `json:"ClientConfig"`
}

Jump to

Keyboard shortcuts

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