nacos

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

* Copyright 1999-2020 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var GetPrivateIP = sockaddr.GetPrivateIP
View Source
var NewNamingClient = clients.NewNamingClient

Functions

func InitialiseNacosNamingClient added in v1.0.6

func InitialiseNacosNamingClient()

func NewNode

func NewNode(data ...map[string]interface{}) error

func Shutdown

func Shutdown()

Types

type INamingClient added in v1.0.6

type INamingClient interface {

	//RegisterInstance use to register instance
	//Ip  require
	//Port  require
	//Tenant optional
	//Weight  require,it must be lager than 0
	//Enable  require,the instance can be access or not
	//Healthy  require,the instance is health or not
	//Metadata  optional
	//ClusterName  optional,default:DEFAULT
	//ServiceName require
	//GroupName optional,default:DEFAULT_GROUP
	//Ephemeral optional
	RegisterInstance(param vo.RegisterInstanceParam) (bool, error)

	//DeregisterInstance use to deregister instance
	//Ip required
	//Port required
	//Tenant optional
	//Cluster optional,default:DEFAULT
	//ServiceName  require
	//GroupName  optional,default:DEFAULT_GROUP
	//Ephemeral optional
	DeregisterInstance(param vo.DeregisterInstanceParam) (bool, error)

	// UpdateInstance use to modify instance
	// Ip required
	// Port required
	// Tenant optional
	// Cluster optional,default:DEFAULT
	// ServiceName  require
	// GroupName  optional,default:DEFAULT_GROUP
	// Ephemeral optional
	// Weight  require,it must be lager than 0
	// Enable  require,the instance can be access or not
	// Metadata  optional
	UpdateInstance(param vo.UpdateInstanceParam) (bool, error)

	//GetService use to get service
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	GetService(param vo.GetServiceParam) (model.Service, error)

	//SelectAllInstance return all instances,include healthy=false,enable=false,weight<=0
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	SelectAllInstances(param vo.SelectAllInstancesParam) ([]model.Instance, error)

	//SelectInstances only return the instances of healthy=${HealthyOnly},enable=true and weight>0
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	//HealthyOnly optional
	SelectInstances(param vo.SelectInstancesParam) ([]model.Instance, error)

	//SelectInstances return one instance by WRR strategy for load balance
	//And the instance should be health=true,enable=true and weight>0
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	SelectOneHealthyInstance(param vo.SelectOneHealthInstanceParam) (*model.Instance, error)

	//Subscribe use to subscribe service change event
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	//SubscribeCallback require
	Subscribe(param *vo.SubscribeParam) error

	//Unsubscribe use to unsubscribe service change event
	//ServiceName require
	//Clusters optional,default:DEFAULT
	//GroupName optional,default:DEFAULT_GROUP
	//SubscribeCallback require
	Unsubscribe(param *vo.SubscribeParam) error

	//GetAllServicesInfo use to get all service info by page
	GetAllServicesInfo(param vo.GetAllServiceInfoParam) (model.ServiceList, error)
}

Directories

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

Jump to

Keyboard shortcuts

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