core

package
v0.0.0-...-91e3901 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressIfNecessary

func CompressIfNecessary(data []byte) []byte

func SelectInstancesWithHealthyProtection

func SelectInstancesWithHealthyProtection(ctx context.Context, result *nacosmodel.ServiceInfo,
	instances []*nacosmodel.Instance, healthCount int32) *nacosmodel.ServiceInfo

func WarpGRPCPushData

func WarpGRPCPushData(p *PushData)

func WarpUDPPushData

func WarpUDPPushData(p *PushData)

func WrirteNacosErrorResponse

func WrirteNacosErrorResponse(data error, resp *restful.Response)

WrirteNacosErrorResponse .

func WrirteNacosResponse

func WrirteNacosResponse(data interface{}, resp *restful.Response)

WrirteNacosResponse .

func WrirteSimpleResponse

func WrirteSimpleResponse(data string, code int, resp *restful.Response)

WrirteSimpleResponse .

Types

type InstanceFilter

type InstanceFilter func(ctx context.Context, svcInfo *nacosmodel.ServiceInfo,
	ins []*nacosmodel.Instance, healthyCount int32) *nacosmodel.ServiceInfo

type KeyHealthyOnly

type KeyHealthyOnly struct{}

type KeyService

type KeyService struct{}

type NacosDataStorage

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

func NewNacosDataStorage

func NewNacosDataStorage(cacheMgr *cache.CacheManager) *NacosDataStorage

func (*NacosDataStorage) ListInstances

func (n *NacosDataStorage) ListInstances(ctx context.Context, svc nacosmodel.ServiceKey,
	clusters []string, filter InstanceFilter) *nacosmodel.ServiceInfo

ListInstances list nacos instances by filter

func (*NacosDataStorage) RunSync

func (n *NacosDataStorage) RunSync()

type PushCenter

type PushCenter interface {
	AddSubscriber(s Subscriber)
	RemoveSubscriber(s Subscriber)
	EnablePush(s Subscriber) bool
	Type() PushType
}

type PushData

type PushData struct {
	Service          *model.Service
	ServiceInfo      *nacosmodel.ServiceInfo
	UDPData          interface{}
	CompressUDPData  []byte
	GRPCData         interface{}
	CompressGRPCData []byte
}

type PushType

type PushType string
const (
	NoopPush     PushType = "noop"
	UDPCPush     PushType = "udp"
	GRPCPush     PushType = "grpc"
	AssemblyPush PushType = "assembly"
)

type ServiceData

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

type Subscriber

type Subscriber struct {
	ConnID      string
	AddrStr     string
	Agent       string
	App         string
	Ip          string
	Port        int
	NamespaceId string
	Group       string
	Service     string
	Cluster     string
	Type        PushType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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