springcloud

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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() interface{}

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