nacos

package
v0.0.0-...-13c49c2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageNo   = "PageNo"
	PageSize = "PageSize"
)
View Source
const (
	DEBUG = "debug"
	INFO  = "info"
	WARN  = "warn"
	ERROR = "error"
)

Variables

View Source
var (
	// IllegalParam
	// This error is usually caused by the logic of the parameters,
	// such as filling in parameters with illegal characters
	IllegalParam = errors.New("illegal parameter")
)

Functions

func NewStore

func NewStore() configstores.Store

Types

type Client

type Client interface {
	// GetConfig use to get config from nacos server
	// dataId  require
	// group   require
	// tenant ==>nacos.namespace optional
	GetConfig(param vo.ConfigParam) (string, error)

	// PublishConfig use to publish config to nacos server
	// dataId  require
	// group   require
	// content require
	// tenant ==>nacos.namespace optional
	PublishConfig(param vo.ConfigParam) (bool, error)

	// DeleteConfig use to delete config
	// dataId  require
	// group   require
	// tenant ==>nacos.namespace optional
	DeleteConfig(param vo.ConfigParam) (bool, error)

	// ListenConfig use to listen config change,it will callback OnChange() when config change
	// dataId  require
	// group   require
	// onchange require
	// tenant ==>nacos.namespace optional
	ListenConfig(params vo.ConfigParam) (err error)

	//CancelListenConfig use to cancel listen config change
	// dataId  require
	// group   require
	// tenant ==>nacos.namespace optional
	CancelListenConfig(params vo.ConfigParam) (err error)

	// SearchConfig use to search nacos config
	// search  require search=accurate--精确搜索  search=blur--模糊搜索
	// group   option
	// dataId  option
	// tenant ==>nacos.namespace optional
	// pageNo  option,default is 1
	// pageSize option,default is 10
	SearchConfig(param vo.SearchConfigParam) (*model.ConfigPage, error)

	// CloseClient Close the GRPC client
	CloseClient()
}

type ConfigStore

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

func (*ConfigStore) Delete

func (n *ConfigStore) Delete(ctx context.Context, request *configstores.DeleteRequest) error

func (*ConfigStore) Get

Get gets configuration from configuration store.

func (*ConfigStore) GetDefaultGroup

func (n *ConfigStore) GetDefaultGroup() string

func (*ConfigStore) GetDefaultLabel

func (n *ConfigStore) GetDefaultLabel() string

func (*ConfigStore) Init

func (n *ConfigStore) Init(config *configstores.StoreConfig) (err error)

Init SetConfig the configuration store.

func (*ConfigStore) OnLogLevelChanged

func (n *ConfigStore) OnLogLevelChanged(outputLevel log.LogLevel)

func (*ConfigStore) Set

func (n *ConfigStore) Set(ctx context.Context, request *configstores.SetRequest) error

func (*ConfigStore) StopSubscribe

func (n *ConfigStore) StopSubscribe()

func (*ConfigStore) Subscribe

func (n *ConfigStore) Subscribe(request *configstores.SubscribeReq, ch chan *configstores.SubscribeResp) error

type DefaultLogger

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

An adapter to implement log.LoggerInterface in agollo package.

func NewDefaultLogger

func NewDefaultLogger(logger log.Logger) *DefaultLogger

func (*DefaultLogger) Debug

func (d *DefaultLogger) Debug(v ...interface{})

func (*DefaultLogger) Debugf

func (d *DefaultLogger) Debugf(format string, params ...interface{})

func (*DefaultLogger) Error

func (d *DefaultLogger) Error(v ...interface{})

func (*DefaultLogger) Errorf

func (d *DefaultLogger) Errorf(format string, params ...interface{})

func (*DefaultLogger) Info

func (d *DefaultLogger) Info(v ...interface{})

func (*DefaultLogger) Infof

func (d *DefaultLogger) Infof(format string, params ...interface{})

func (*DefaultLogger) Warn

func (d *DefaultLogger) Warn(v ...interface{})

func (*DefaultLogger) Warnf

func (d *DefaultLogger) Warnf(format string, params ...interface{})

type Metadata

type Metadata struct {
	NameSpaceId string
	Username    string
	Password    string
	// ACM & KMS
	Endpoint  string
	RegionId  string
	AccessKey string
	SecretKey string
	OpenKMS   bool
	// log & cache files
	LogDir   string
	CacheDir string
	LogLevel string
}

func ParseNacosMetadata

func ParseNacosMetadata(properties map[string]string) (*Metadata, error)

type OnChangeFunc

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

type Pagination

type Pagination struct {
	PageNo   int
	PageSize int
}

Jump to

Keyboard shortcuts

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