nacos

package
v0.1.101 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendNode added in v0.1.99

type BackendNode struct {
	BackendAddr   string
	NamespaceName string
	AccessToken   string
}

type Client

type Client struct {
	BackendNodes   []BackendNode
	Password       string
	Username       string
	Namespace      string
	AccessKey      string
	SecretKey      string
	CircleInterval int
}

func NewNacosClient

func NewNacosClient(
	backendNodes []string,
	password,
	username,
	namespace,
	accessKey,
	secretKey string,
	circleInterval int,
) (*Client, error)

NewNacosClient create nacos client.

func (*Client) Close added in v0.1.99

func (c *Client) Close()

func (*Client) GetValues

func (c *Client) GetValues(keys []string) (map[string]string, error)

GetValues get all dataID prefix in this namespace.

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(prefix string, keys []string, waitIndex uint64, stopChan chan bool) (uint64, error)

WatchPrefix watch all namespace. If creat new dataID, perhaps delay 60S. @prefix @keys all useful.

type NamespacePageItem added in v0.1.99

type NamespacePageItem struct {
	Namespace         string `json:"namespace"`
	NamespaceShowName string `json:"namespaceShowName"`
	NamespaceDesc     string `json:"namespaceDesc"`
	Quota             int    `json:"quota"`
	ConfigCount       int    `json:"configCount"`
	Type              int    `json:"type"`
}

type NamespaceResponse added in v0.1.99

type NamespaceResponse struct {
	Code    int                 `json:"code"`
	Message string              `json:"message"`
	Data    []NamespacePageItem `json:"data"`
}

type RspBody added in v0.1.99

type RspBody struct {
	AccessToken string `json:"accessToken"`
	TokenTtl    int    `json:"tokenTtl"`
	GlobalAdmin bool   `json:"globalAdmin"`
	Username    string `json:"username"`
}

type ValuesPageItem added in v0.1.99

type ValuesPageItem struct {
	ID               string `json:"id"`
	DataId           string `json:"dataId"`
	Group            string `json:"group"`
	Content          string `json:"content"`
	Md5              string `json:"md5"`
	EncryptedDataKey string `json:"encryptedDataKey"`
	Tenant           string `json:"tenant"`
	AppName          string `json:"appName"`
	Type             string `json:"type"`
}

type ValuesResponse added in v0.1.99

type ValuesResponse struct {
	TotalCount     int              `json:"totalCount"`
	PageNumber     int              `json:"pageNumber"`
	PagesAvailable int              `json:"pagesAvailable"`
	PageItems      []ValuesPageItem `json:"pageItems"`
}

Jump to

Keyboard shortcuts

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