server

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = map[string]ServerInfo{}

Functions

func GetNacosClient

func GetNacosClient(nacosConfig nacos.ConnectConfig) naming_client.INamingClient

GetNacosClient 获取系统配置

func GetServerAddress

func GetServerAddress(serverName string) (string, error)

GetServerAddress 获取服务信息

func InitServer

func InitServer(client naming_client.INamingClient, serverList []ServerGroup)

InitServer 当前服务配置初始化

func InitServerConfig

func InitServerConfig(config nacos.ConnectConfig, serverName string, ServerList []Server)

InitServerConfig 初始化个服务配置信息

func SubscribeServer

func SubscribeServer(client naming_client.INamingClient, serverList []ServerGroup)

SubscribeServer 订阅服务

Types

type Server

type Server struct {
	Name  string `yaml:"name"`
	Group string `yaml:"group"`
	Desc  string `yaml:"desc"`
}

type ServerGroup

type ServerGroup struct {
	ServiceName string   `param:"serviceName"` // required
	Clusters    []string `param:"clusters"`    // optional,default:DEFAULT
	GroupName   string   `param:"groupName"`   // optional,default:DEFAULT_GROUP
}

type ServerInfo

type ServerInfo struct {
	Describe string `json:"describe,omitempty"`
	Host     string `json:"host,omitempty"`
	Port     string `json:"port,omitempty"`
}

Jump to

Keyboard shortcuts

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