nacos

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetConfigUrl        = "http://%s/nacos/v1/cs/configs?tenant=%s&group=%s&dataId=%s"
	GetConfigAllInfoUrl = "http://%s/nacos/v1/cs/configs?show=all&tenant=%s&group=%s&dataId=%s"
	ListenerUrl         = "http://%s/nacos/v1/cs/configs/listener"
	InitParam           = "Listening-Configs=%s" + string(rune(2)) + "%s" + string(rune(2)) + "%s" + string(rune(2)) + "%s" + string(rune(1))
)
View Source
const (
	CreateServiceUrl      = "http://%s/nacos/v1/ns/service"
	CreateServiceParam    = "serviceName=%s&groupName=%s&namespaceId=%s&protectThreshold=0&metadata=%s"
	GetServiceUrl         = "http://%s/nacos/v1/ns/service?serviceName=%s&groupName=%s&namespaceId=%s&protectThreshold=0"
	GetServiceListUrl     = "http://%s/nacos/v1/ns/service/list?pageNo=%s&pageSize=%s&serviceName=%s&groupName=%s&namespaceId=%s"
	RegisterInstanceUrl   = "http://%s/nacos/v1/ns/instance"
	RegisterInstanceParam = "port=%s&ip=%s&serviceName=%s&groupName=%s&namespaceId=%s"
	BeatParam             = "serviceName=%s&groupName=%s&beat=%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*Config
	MD5 string `json:"md5"`
	// contains filtered or unexported fields
}

func (*Client) GetConfigAllInfo

func (c *Client) GetConfigAllInfo() ([]byte, error)

func (*Client) GetConfigAllInfoHandle

func (c *Client) GetConfigAllInfoHandle(handle func([]byte)) error

func (*Client) Listener

func (c *Client) Listener(handle func([]byte))

type Config

type Config struct {
	Addr   string `json:"addr"`
	Tenant string `json:"tenant"`
	Group  string `json:"group"`
	DataId string `json:"dataId"`
	Watch  bool
}

func (*Config) CreateService

func (c *Config) CreateService(svcName string, metadata *Metadata) error

func (*Config) DeleteInstance

func (c *Config) DeleteInstance(port, svcName string) error

func (*Config) Generate

func (c *Config) Generate() interface{}

func (*Config) GetConfig

func (c *Config) GetConfig() ([]byte, error)

func (*Config) GetService

func (c *Config) GetService(svcName string) (*Service, error)

func (*Config) GetServiceEndPort

func (c *Config) GetServiceEndPort(svcName string) string

func (*Config) InstanceBeat

func (c *Config) InstanceBeat(svcName string) error

func (*Config) NewClient

func (c *Config) NewClient() *Client

func (*Config) RegisterInstance

func (c *Config) RegisterInstance(port, svcName string) error

type ConfigInfo

type ConfigInfo struct {
	ID         int64  `json:"id"`
	AppName    string `json:"appName"`
	Content    string `json:"content"`
	CreateIp   string `json:"createIp"`
	CreateTime int64  `json:"createTime"`
	DataId     string `json:"dataId"`
	Desc       string `json:"desc"`
	Effect     string `json:"effect"`
	Group      string `json:"group"`
	MD5        string `json:"md5"`
	ModifyTime int64  `json:"modifyTime"`
	Type       string `json:"type"`
}

type Metadata

type Metadata struct {
	Domain string `json:"domain"`
	Port   string `json:"port"`
}

type Service

type Service struct {
	Metadata         Metadata `json:"metadata"`
	Name             string   `json:"name"`
	Selector         Type     `json:"selector"`
	ProtectThreshold float32  `json:"protectThreshold"`
	Clusters         []struct {
		HealthChecker Type   `json:"healthChecker"`
		Name          string `json:"name"`
	}
}

type Type

type Type struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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