springcloud

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Kind is the kind of Adapter Plugin.
	Kind = constant.SpringCloudAdapter

	Nacos     = "nacos"
	Zookeeper = "zookeeper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudAdapter

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

CloudAdapter the adapter for spring cloud

func (*CloudAdapter) Apply

func (a *CloudAdapter) Apply() error

Apply init

func (*CloudAdapter) Config

func (a *CloudAdapter) Config() any

Config get config for Adapter

func (*CloudAdapter) GetServiceNames

func (a *CloudAdapter) GetServiceNames() []string

func (*CloudAdapter) OnAddServiceInstance

func (a *CloudAdapter) OnAddServiceInstance(instance *servicediscovery.ServiceInstance)

func (*CloudAdapter) OnDeleteServiceInstance

func (a *CloudAdapter) OnDeleteServiceInstance(instance *servicediscovery.ServiceInstance)

func (*CloudAdapter) OnUpdateServiceInstance

func (a *CloudAdapter) OnUpdateServiceInstance(instance *servicediscovery.ServiceInstance)

func (*CloudAdapter) Start

func (a *CloudAdapter) Start()

Start start the adapter

func (*CloudAdapter) Stop

func (a *CloudAdapter) Stop()

Stop stop the adapter

type CloudPlugin

type CloudPlugin struct {
}

CloudPlugin the adapter plugin for spring cloud

func (*CloudPlugin) CreateAdapter

func (p *CloudPlugin) CreateAdapter(ad *model.Adapter) (adapter.Adapter, error)

CreateAdapter create adapter

func (*CloudPlugin) Kind

func (p *CloudPlugin) Kind() string

Kind return plugin kind

type Config

type Config struct {
	// Mode default 0 start backgroup fresh and watch, 1 only fresh 2 only watch
	Mode          int                 `yaml:"mode" json:"mode" default:"mode"`
	Registry      *model.RemoteConfig `yaml:"registry" json:"registry" default:"registry"`
	FreshInterval time.Duration       `yaml:"freshInterval" json:"freshInterval" default:"freshInterval"`
	Services      []string            `yaml:"services" json:"services" default:"services"`
	// SubscribePolicy subscribe config,
	// - adapting : if there is no any Services (App) names, fetch All services from registry center
	// - definitely : fetch services by the config Services (App) names
	SubscribePolicy string `yaml:"subscribe-policy" json:"subscribe-policy" default:"adapting"`
}

Config the config for CloudAdapter

type Service

type Service struct {
	Name string
}

type SubscribePolicy

type SubscribePolicy int
const (
	Adapting SubscribePolicy = iota
	Definitely
)

func (SubscribePolicy) String

func (sp SubscribePolicy) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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