flow

package
v1.5.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AllNamespace = "*"
)

Variables

This section is empty.

Functions

func InitFlowEngine

func InitFlowEngine(flowEngine *Engine, initContext plugin.InitContext) error

InitFlowEngine 初始化flowEngine实例

Types

type CombineNotifyContext

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

CombineNotifyContext 复合的回调上下文,等待所有的子回调都返回才会触发回调

func NewCombineNotifyContext

func NewCombineNotifyContext(svcKey *model.ServiceKey, notifiers []*SingleNotifyContext) *CombineNotifyContext

NewCombineNotifyContext 创建复合回调上下文

func (*CombineNotifyContext) Errs

Errs 获取错误信息集合

func (*CombineNotifyContext) IsDone

func (c *CombineNotifyContext) IsDone() bool

IsDone 是否已经完成

func (*CombineNotifyContext) Wait

func (c *CombineNotifyContext) Wait(timeout time.Duration) (exceedTime bool)

Wait notify 异步任务执行回调函数 返回值,是否超时

type ContextKey

type ContextKey struct {
	// 服务信息
	ServiceKey *model.ServiceKey
	// 操作信息
	Operation string
}

ContextKey 上下文标识

func (ContextKey) String

func (c ContextKey) String() string

String ToString方法

type Engine

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

Engine 编排调度引擎,API相关逻辑在这里执行

func (*Engine) AsyncGetQuota

func (e *Engine) AsyncGetQuota(request *model.QuotaRequestImpl) (*model.QuotaFutureImpl, error)

AsyncGetQuota 异步获取配额信息

func (*Engine) Destroy

func (e *Engine) Destroy() error

Destroy 销毁流程引擎

func (*Engine) FlowQuotaAssistant

func (e *Engine) FlowQuotaAssistant() *quota.FlowQuotaAssistant

FlowQuotaAssistant 获取流程辅助类

func (*Engine) GetContext

func (e *Engine) GetContext() model.ValueContext

GetContext 获取上下文

func (*Engine) InitCalleeService

func (e *Engine) InitCalleeService(req *model.InitCalleeServiceRequest) error

InitCalleeService 初始化服务运行中需要的被调服务

func (*Engine) LoadFlowRouteChain

func (e *Engine) LoadFlowRouteChain() error

LoadFlowRouteChain 加载服务路由链插件

func (*Engine) PluginSupplier

func (e *Engine) PluginSupplier() plugin.Supplier

PluginSupplier 获取插件工厂

func (*Engine) ProcessLoadBalance

func (e *Engine) ProcessLoadBalance(req *model.ProcessLoadBalanceRequest) (*model.OneInstanceResponse, error)

ProcessLoadBalance 执行负载均衡策略,返回负载均衡后的实例

func (*Engine) ProcessRouters

func (e *Engine) ProcessRouters(req *model.ProcessRoutersRequest) (*model.InstancesResponse, error)

ProcessRouters 执行路由链过滤,返回经过路由后的实例列表

func (*Engine) ScheduleTask

func (e *Engine) ScheduleTask(task *model.PeriodicTask) (chan<- *model.PriorityTask, model.TaskValues)

ScheduleTask 调度任务

func (*Engine) ServiceEventCallback

func (e *Engine) ServiceEventCallback(event *common.PluginEvent) error

ServiceEventCallback serviceUpdate消息订阅回调

func (*Engine) Start

func (e *Engine) Start() error

Start 启动引擎

func (*Engine) SyncDeregister

func (e *Engine) SyncDeregister(instance *model.InstanceDeRegisterRequest) error

SyncDeregister 同步进行服务反注册

func (*Engine) SyncGetAllInstances

func (e *Engine) SyncGetAllInstances(req *model.GetAllInstancesRequest) (*model.InstancesResponse, error)

SyncGetAllInstances 同步获取服务实例

func (*Engine) SyncGetConfigFile

func (e *Engine) SyncGetConfigFile(namespace, fileGroup, fileName string) (model.ConfigFile, error)

SyncGetConfigFile 同步获取配置文件

func (*Engine) SyncGetInstances

func (e *Engine) SyncGetInstances(req *model.GetInstancesRequest) (*model.InstancesResponse, error)

SyncGetInstances 同步获取服务实例

func (*Engine) SyncGetOneInstance

func (e *Engine) SyncGetOneInstance(req *model.GetOneInstanceRequest) (*model.OneInstanceResponse, error)

SyncGetOneInstance 同步获取服务实例

func (*Engine) SyncGetResources

func (e *Engine) SyncGetResources(req model.CacheValueQuery) error

SyncGetResources 同步加载资源

func (*Engine) SyncGetServiceRule

func (e *Engine) SyncGetServiceRule(
	eventType model.EventType, req *model.GetServiceRuleRequest) (*model.ServiceRuleResponse, error)

SyncGetServiceRule 同步获取服务规则

func (*Engine) SyncGetServices

func (e *Engine) SyncGetServices(eventType model.EventType,
	req *model.GetServicesRequest) (*model.ServicesResponse, error)

SyncGetServices 获取服务列表

func (*Engine) SyncHeartbeat

func (e *Engine) SyncHeartbeat(instance *model.InstanceHeartbeatRequest) error

SyncHeartbeat 同步进行心跳上报

func (*Engine) SyncRegister

SyncRegister 同步进行服务注册

func (*Engine) SyncRegisterV2

func (e *Engine) SyncRegisterV2(request *model.InstanceRegisterRequest) (*model.InstanceRegisterResponse, error)

SyncRegisterV2 async-regis

func (*Engine) SyncReportStat

func (e *Engine) SyncReportStat(typ model.MetricType, stat model.InstanceGauge) error

SyncReportStat 上报统计数据到统计插件中

func (*Engine) SyncUpdateServiceCallResult

func (e *Engine) SyncUpdateServiceCallResult(result *model.ServiceCallResult) error

SyncUpdateServiceCallResult 同步上报调用结果信息

func (*Engine) WatchAllInstances

func (e *Engine) WatchAllInstances(request *model.WatchAllInstancesRequest) (*model.WatchAllInstancesResponse, error)

WatchAllInstances 监听所有的实例

func (*Engine) WatchAllServices

func (e *Engine) WatchAllServices(request *model.WatchAllServicesRequest) (*model.WatchAllServicesResponse, error)

WatchAllServices 监听所有的服务列表

func (*Engine) WatchService

func (e *Engine) WatchService(req *model.WatchServiceRequest) (*model.WatchServiceResponse, error)

WatchService watch service

type LongPullContext

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

func NewLongPullContext

func NewLongPullContext(
	id uint64, waitIndex uint64, waitTime time.Duration, svcEventKey model.ServiceEventKey) *LongPullContext

func (*LongPullContext) Cancel

func (l *LongPullContext) Cancel()

func (*LongPullContext) OnInstances

func (l *LongPullContext) OnInstances(value model.ServiceInstances)

func (*LongPullContext) OnServices

func (l *LongPullContext) OnServices(value model.Services)

func (*LongPullContext) ServiceEventKey

func (l *LongPullContext) ServiceEventKey() model.ServiceEventKey

func (*LongPullContext) Start

func (l *LongPullContext) Start()

type NotifyUpdateContext

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

func (*NotifyUpdateContext) Cancel

func (l *NotifyUpdateContext) Cancel()

func (*NotifyUpdateContext) OnInstances

func (l *NotifyUpdateContext) OnInstances(value model.ServiceInstances)

func (*NotifyUpdateContext) OnServices

func (l *NotifyUpdateContext) OnServices(value model.Services)

func (*NotifyUpdateContext) ServiceEventKey

func (l *NotifyUpdateContext) ServiceEventKey() model.ServiceEventKey

type SingleNotifyContext

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

SingleNotifyContext 同步调用回调上下文

func NewSingleNotifyContext

func NewSingleNotifyContext(name *ContextKey, notifier *common.Notifier) *SingleNotifyContext

NewSingleNotifyContext 创建回调上下文

func (*SingleNotifyContext) Err

Err 返回异常信息返回异常信息

func (*SingleNotifyContext) Wait

func (s *SingleNotifyContext) Wait(timeout time.Duration) bool

Wait notify 异步任务执行回调函数

type WatchContext

type WatchContext interface {
	ServiceEventKey() model.ServiceEventKey
	OnInstances(value model.ServiceInstances)
	OnServices(value model.Services)
	Cancel()
}

type WatchEngine

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

func NewWatchEngine

func NewWatchEngine(registry localregistry.LocalRegistry) *WatchEngine

func (*WatchEngine) CancelWatch

func (w *WatchEngine) CancelWatch(watchId uint64)

func (*WatchEngine) ServiceEventCallback

func (w *WatchEngine) ServiceEventCallback(event *common.PluginEvent) error

ServiceEventCallback serviceUpdate消息订阅回调

func (*WatchEngine) WatchAllInstances

func (w *WatchEngine) WatchAllInstances(
	request *model.WatchAllInstancesRequest) (*model.WatchAllInstancesResponse, error)

func (*WatchEngine) WatchAllServices

func (w *WatchEngine) WatchAllServices(
	request *model.WatchAllServicesRequest) (*model.WatchAllServicesResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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