cluster_impl

package
v3.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 108

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAvailableCluster

func NewAvailableCluster() cluster.Cluster

NewAvailableCluster returns a cluster instance

Obtain available service providers

func NewAvailableClusterInvoker

func NewAvailableClusterInvoker(directory cluster.Directory) protocol.Invoker

NewAvailableClusterInvoker returns a cluster invoker instance

func NewBroadcastCluster

func NewBroadcastCluster() cluster.Cluster

NewBroadcastCluster returns a broadcast cluster instance.

Calling all providers' broadcast one by one. All errors will be reported. It is usually used to notify all providers to update local resource information such as caches or logs.

func NewFailFastCluster

func NewFailFastCluster() cluster.Cluster

NewFailFastCluster returns a failfast cluster instance.

Fast failure, only made a call, failure immediately error. Usually used for non-idempotent write operations, such as adding records.

func NewFailbackCluster

func NewFailbackCluster() cluster.Cluster

NewFailbackCluster returns a failback cluster instance

Failure automatically restored, failed to record the background request, regular retransmission. Usually used for message notification operations.

func NewFailoverCluster

func NewFailoverCluster() cluster.Cluster

NewFailoverCluster returns a failover cluster instance

Failure automatically switch, when there is a failure, retry the other server (default). Usually used for read operations, but retries can result in longer delays.

func NewFailsafeCluster

func NewFailsafeCluster() cluster.Cluster

NewFailsafeCluster returns a failsafe cluster instance.

Failure of security, anomalies, directly ignored. Usually it is used to write audit logs and other operations.

func NewForkingCluster

func NewForkingCluster() cluster.Cluster

NewForkingCluster returns a forking cluster instance.

Multiple servers are invoked in parallel, returning as soon as one succeeds. Usually it is used for real-time demanding read operations while wasting more service resources.

func NewMockCluster

func NewMockCluster() cluster.Cluster

NewMockCluster returns a mock cluster instance.

Mock cluster is usually used for service degradation, such as an authentication service. When the service provider is completely hung up, the client does not throw an exception, return an authorization failure through the Mock data instead.

func NewZoneAwareCluster

func NewZoneAwareCluster() cluster.Cluster

NewZoneAwareCluster returns a zoneaware cluster instance.

More than one registry for subscription. Usually it is used for choose between registries.

Types

type InterceptorInvoker

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

InterceptorInvoker mocks cluster interceptor as an invoker

func (*InterceptorInvoker) Destroy

func (i *InterceptorInvoker) Destroy()

Destroy will destroy invoker

func (*InterceptorInvoker) GetURL

func (i *InterceptorInvoker) GetURL() *common.URL

GetURL is used to get url from InterceptorInvoker

func (*InterceptorInvoker) Invoke

Invoke is used to call service method by invocation

func (*InterceptorInvoker) IsAvailable

func (i *InterceptorInvoker) IsAvailable() bool

IsAvailable is used to get available status

Jump to

Keyboard shortcuts

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