configs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvNacosAddr = "env_nacos_addr"
)

Variables

This section is empty.

Functions

func Get

func Get(key string) string

func GetByKind

func GetByKind(kind, key string) string

func GetByKindByDefault

func GetByKindByDefault(kind, key string, defaultValue string) string

func GetInt

func GetInt(key string) int

func GetIntByKind

func GetIntByKind(kind, key string) int

func GetIntByKindOrDefault

func GetIntByKindOrDefault(kind, key string, defaultValue int) int

func GetIntOrDefault

func GetIntOrDefault(key string, defaultValue int) int

func GetJSON

func GetJSON(key string, out interface{})

func GetJSONByKind

func GetJSONByKind(kind, key string, out interface{})

func GetOrDefault

func GetOrDefault(key string, defaultValue string) string

func GetYaml

func GetYaml(key string, out interface{})

func GetYamlByKind

func GetYamlByKind(kind, key string, out interface{})

func MonitorChange

func MonitorChange(kind, key string, callback ConfigChangeCallback)

Types

type ConfigChangeCallback

type ConfigChangeCallback func(newvalue string)

type IClient

type IClient interface {
	Name() string
	Get(kind, key string) string
	BatchGet(kind string, keys ...string) map[string]string
	MonitorChange(kind, key string, fn ConfigChangeCallback)
}

type NacosClient

type NacosClient struct {
	// contains filtered or unexported fields
}

func NewNacosClient

func NewNacosClient() (*NacosClient, error)

func (*NacosClient) BatchGet

func (client *NacosClient) BatchGet(kind string, keys ...string) map[string]string

func (*NacosClient) Get

func (client *NacosClient) Get(kind, key string) string

func (*NacosClient) MonitorChange

func (client *NacosClient) MonitorChange(kind, key string, fn ConfigChangeCallback)

func (*NacosClient) Name

func (client *NacosClient) Name() string

Directories

Path Synopsis
Package mock_configs is a generated GoMock package.
Package mock_configs is a generated GoMock package.

Jump to

Keyboard shortcuts

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