service

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RevisionConcurrenceCount Revision计算的并发线程数
	RevisionConcurrenceCount = 64
	// RevisionChanCount 存储revision计算的通知管道,可以稍微设置大一点
	RevisionChanCount = 102400
)
View Source
const (
	MetadataInstanceLastHeartbeatTime = "internal-lastheartbeat"
)
View Source
const (
	ServiceContractName = "serviceContract"
)

Variables

This section is empty.

Functions

func ComputeRevision

func ComputeRevision(serviceRevision string, instances []*model.Instance) (string, error)

ComputeRevision 计算唯一的版本标识

func NewCircuitBreakerCache

func NewCircuitBreakerCache(s store.Store, cacheMgr types.CacheManager) types.CircuitBreakerCache

NewCircuitBreakerCache 返回一个操作CircuitBreakerCache的对象

func NewFaultDetectCache

func NewFaultDetectCache(s store.Store, cacheMgr types.CacheManager) types.FaultDetectCache

NewFaultDetectCache faultDetectCache constructor

func NewInstanceCache

func NewInstanceCache(storage store.Store, cacheMgr types.CacheManager) types.InstanceCache

NewInstanceCache 新建一个instanceCache

func NewL5Cache

func NewL5Cache(s store.Store, cacheMgr types.CacheManager) types.L5Cache

func NewRateLimitCache

func NewRateLimitCache(s store.Store, cacheMgr types.CacheManager) types.RateLimitCache

NewRateLimitCache 返回一个操作RateLimitCache的对象

func NewRoutingConfigCache

func NewRoutingConfigCache(s store.Store, cacheMgr types.CacheManager) types.RoutingConfigCache

NewRoutingConfigCache Return a object of operating RoutingConfigcache

func NewServiceCache

func NewServiceCache(storage store.Store, cacheMgr types.CacheManager) types.ServiceCache

NewServiceCache 返回一个serviceCache

func NewServiceContractCache added in v1.18.0

func NewServiceContractCache(storage store.Store, cacheMgr types.CacheManager) types.ServiceContractCache

Types

type InstanceSearchArgs

type InstanceSearchArgs struct {
	SvcName      *string
	SvcNs        *string
	InstanceID   *string
	Hosts        map[string]struct{}
	Port         *uint32
	Protocol     *string
	Version      *string
	Region       *string
	Zone         *string
	Campus       *string
	Weight       *uint32
	HealthStatus *bool
	Isolate      *bool
	MetaFilter   map[string]string
}

InstanceSearchArgs .

func (*InstanceSearchArgs) String

func (args *InstanceSearchArgs) String() string

type ServiceRevisionWorker

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

func (*ServiceRevisionWorker) GetServiceInstanceRevision

func (sc *ServiceRevisionWorker) GetServiceInstanceRevision(serviceID string) string

GetServiceInstanceRevision 获取服务实例计算之后的revision

func (*ServiceRevisionWorker) GetServiceRevisionCount

func (sc *ServiceRevisionWorker) GetServiceRevisionCount() int

GetServiceRevisionCount 计算一下缓存中的revision的个数

func (*ServiceRevisionWorker) Notify

func (sc *ServiceRevisionWorker) Notify(serviceID string, valid bool)

type ServiceWithRouterRules

type ServiceWithRouterRules struct {
	Service model.ServiceKey

	Revision string
	// contains filtered or unexported fields
}

ServiceWithCircuitBreakerRules 与服务关系绑定的熔断规则

func NewServiceWithRouterRules

func NewServiceWithRouterRules(svcKey model.ServiceKey) *ServiceWithRouterRules

func (*ServiceWithRouterRules) AddRouterRule

func (s *ServiceWithRouterRules) AddRouterRule(rule *model.ExtendRouterConfig)

func (*ServiceWithRouterRules) Clear

func (s *ServiceWithRouterRules) Clear()

func (*ServiceWithRouterRules) CountRouterRules

func (s *ServiceWithRouterRules) CountRouterRules() int

func (*ServiceWithRouterRules) DelRouterRule

func (s *ServiceWithRouterRules) DelRouterRule(id string)

func (*ServiceWithRouterRules) IterateRouterRules

func (s *ServiceWithRouterRules) IterateRouterRules(callback func(*model.ExtendRouterConfig))

Jump to

Keyboard shortcuts

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