extension

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 25 Imported by: 31

Documentation

Index

Constants

View Source
const (
	// DefaultKey for default Configurator
	DefaultKey = "default"
)

Variables

This section is empty.

Functions

func AddCustomShutdownCallback added in v1.3.0

func AddCustomShutdownCallback(callback func())

*

  • AddCustomShutdownCallback
  • you should not make any assumption about the order.
  • For example, if you have more than one callbacks, and you wish the order is:
  • callback1()
  • callback2()
  • ...
  • callbackN()
  • Then you should put then together:
  • func callback() {
  • callback1()
  • callback2()
  • ...
  • callbackN()
  • }
  • I think the order of custom callbacks should be decided by the users.
  • Even though I can design a mechanism to support the ordered custom callbacks,
  • the benefit of that mechanism is low.
  • And it may introduce much complication for another users.

func AddCustomizers added in v1.5.0

func AddCustomizers(cus registry.ServiceInstanceCustomizer)

AddCustomizers will put the customizer into slices and then sort them; this method will be invoked several time, so we sort them here.

func AddEventListener added in v1.5.0

func AddEventListener(creator func() observer.EventListener)

AddEventListener it will be added in global event dispatcher

func AllReferencesConnectComplete added in v1.5.8

func AllReferencesConnectComplete()

AllReferencesConnectComplete emit all references config load complete event

func AllServicesListenComplete added in v1.5.8

func AllServicesListenComplete()

AllServicesListenComplete emit all services config load complete event

func BeforeShutdown added in v1.5.8

func BeforeShutdown()

BeforeShutdown emit before os.Exit(0)

func GetAccesskeyStorages added in v1.4.0

func GetAccesskeyStorages(name string) filter.AccessKeyStorage

GetAccesskeyStorages finds the storage with the @name. Panic if not found

func GetAllCustomShutdownCallbacks added in v1.3.0

func GetAllCustomShutdownCallbacks() *list.List

GetAllCustomShutdownCallbacks gets all custom shutdown callbacks

func GetAuthenticator added in v1.4.0

func GetAuthenticator(name string) filter.Authenticator

GetAuthenticator finds the Authenticator with @name Panic if not found

func GetCluster

func GetCluster(name string) cluster.Cluster

GetCluster finds the cluster fault-tolerant mode with @name

func GetClusterInterceptor added in v1.5.7

func GetClusterInterceptor(name string) cluster.Interceptor

GetClusterInterceptor returns the cluster interceptor instance with the given name

func GetClusterInterceptors added in v1.5.7

func GetClusterInterceptors() []cluster.Interceptor

GetClusterInterceptors returns all instances of registered cluster interceptors

func GetConfigCenter

func GetConfigCenter(name string, config *common.URL) (config_center.DynamicConfiguration, error)

GetConfigCenter finds the DynamicConfiguration with @name

func GetConfigCenterFactory

func GetConfigCenterFactory(name string) config_center.DynamicConfigurationFactory

GetConfigCenterFactory finds the DynamicConfigurationFactory with @name

func GetConfigLoadProcessor added in v1.5.8

func GetConfigLoadProcessor(name string) interfaces.ConfigLoadProcessor

GetConfigLoadProcessor finds a ConfigLoadProcessor by name.

func GetConfigLoadProcessors added in v1.5.8

func GetConfigLoadProcessors() []interfaces.ConfigLoadProcessor

GetConfigLoadProcessors returns all registered instances of ConfigLoadProcessor.

func GetConfigPostProcessor added in v1.5.6

func GetConfigPostProcessor(name string) interfaces.ConfigPostProcessor

GetConfigPostProcessor finds a ConfigPostProcessor by name.

func GetConfigPostProcessors added in v1.5.6

func GetConfigPostProcessors() []interfaces.ConfigPostProcessor

GetConfigPostProcessors returns all registered instances of ConfigPostProcessor.

func GetConfigReaders added in v1.4.0

func GetConfigReaders(name string) interfaces.ConfigReader

GetConfigReaders gets a config reader with @name

func GetConfigurator added in v1.2.0

func GetConfigurator(name string, url *common.URL) config_center.Configurator

GetConfigurator finds the Configurator with @name

func GetCustomizers added in v1.5.0

func GetCustomizers() []registry.ServiceInstanceCustomizer

GetCustomizers will return the sorted customizer the result won't be nil

func GetDefaultConfigReader added in v1.4.0

func GetDefaultConfigReader() map[string]string

GetDefaultConfigReader gets default config reader

func GetDefaultConfigurator added in v1.2.0

func GetDefaultConfigurator(url *common.URL) config_center.Configurator

GetDefaultConfigurator gets default configurator

func GetDefaultConfiguratorFunc added in v1.2.0

func GetDefaultConfiguratorFunc() getConfiguratorFunc

GetDefaultConfiguratorFunc gets default configurator function

func GetDefaultRegistryDirectory added in v1.5.0

func GetDefaultRegistryDirectory(config *common.URL, registry registry.Registry) (cluster.Directory, error)

GetDefaultRegistryDirectory finds the registryDirectory with url and registry

func GetFileRouterFactories added in v1.4.0

func GetFileRouterFactories() map[string]router.FilePriorityRouterFactory

GetFileRouterFactories gets all create file router factory instance

func GetFilter

func GetFilter(name string) filter.Filter

GetFilter finds the filter extension with @name

func GetGlobalDispatcher added in v1.5.0

func GetGlobalDispatcher() observer.EventDispatcher

GetGlobalDispatcher will init all listener and then return dispatcher

func GetGlobalServiceNameMapping added in v1.5.0

func GetGlobalServiceNameMapping() mapping.ServiceNameMapping

func GetHealthChecker added in v1.4.0

func GetHealthChecker(name string, url *common.URL) router.HealthChecker

GetHealthChecker gets the HealthChecker with @name

func GetLoadbalance

func GetLoadbalance(name string) cluster.LoadBalance

GetLoadbalance finds the loadbalance extension with @name

func GetMetadataReportFactory added in v1.5.0

func GetMetadataReportFactory(name string) factory.MetadataReportFactory

GetMetadataReportFactory finds the MetadataReportFactory with @name

func GetMetadataService added in v1.5.0

func GetMetadataService(msType string) (service.MetadataService, error)

GetMetadataService will create a MetadataService instance

func GetMetadataServiceProxyFactory added in v1.5.0

func GetMetadataServiceProxyFactory(name string) service.MetadataServiceProxyFactory

GetMetadataServiceProxyFactory will create an instance. it will panic if the factory with name not found

func GetMetricReporter added in v1.4.0

func GetMetricReporter(name string) metrics.Reporter

GetMetricReporter finds the reporter with @name. if not found, it will panic. we should know that this method usually is called when system starts, so we should panic

func GetNewRestClient added in v1.4.0

func GetNewRestClient(name string, restOptions *client.RestOptions) client.RestClient

GetNewRestClient finds the RestClient with @name

func GetNewRestServer added in v1.4.0

func GetNewRestServer(name string) server.RestServer

GetNewRestServer finds the RestServer with @name

func GetProtocol

func GetProtocol(name string) protocol.Protocol

GetProtocol finds the protocol extension with @name

func GetProxyFactory

func GetProxyFactory(name string) proxy.ProxyFactory

GetProxyFactory finds the ProxyFactory extension with @name

func GetReferenceURL added in v1.5.8

func GetReferenceURL() map[string][]*common.URL

GetReferenceURL returns the URL of all clones of references

func GetRegistry

func GetRegistry(name string, config *common.URL) (registry.Registry, error)

GetRegistry finds the registry extension with @name

func GetRejectedExecutionHandler added in v1.2.0

func GetRejectedExecutionHandler(name string) filter.RejectedExecutionHandler

GetRejectedExecutionHandler finds the RejectedExecutionHandler with @name

func GetRemoteMetadataService added in v1.5.6

func GetRemoteMetadataService() (service.MetadataService, error)

GetRemoteMetadataService will get a RemoteMetadataService instance

func GetRouterFactories added in v1.4.0

func GetRouterFactories() map[string]func() router.PriorityRouterFactory

GetRouterFactories gets all create router factory function

func GetRouterFactory

func GetRouterFactory(name string) router.PriorityRouterFactory

GetRouterFactory gets create router factory function by @name

func GetServiceDiscovery added in v1.5.0

func GetServiceDiscovery(protocol string, name string) (registry.ServiceDiscovery, error)

GetServiceDiscovery will return the registry.ServiceDiscovery protocol indicate the implementation, like nacos the name like nacos-1... if not found, or initialize instance failed, it will return error.

func GetServiceInstanceSelector added in v1.5.0

func GetServiceInstanceSelector(name string) (instance.ServiceInstanceSelector, error)

GetServiceInstanceSelector will create an instance it will panic if selector with the @name not found

func GetServiceURL added in v1.5.8

func GetServiceURL() map[string][]*common.URL

GetServiceURL returns the URL of all clones of services

func GetTpsLimitStrategyCreator added in v1.2.0

func GetTpsLimitStrategyCreator(name string) filter.TpsLimitStrategyCreator

GetTpsLimitStrategyCreator finds the TpsLimitStrategyCreator with @name

func GetTpsLimiter added in v1.2.0

func GetTpsLimiter(name string) filter.TpsLimiter

GetTpsLimiter finds the TpsLimiter with @name

func LoadProcessReferenceConfig added in v1.5.8

func LoadProcessReferenceConfig(url *common.URL, event string, errMsg *string)

LoadProcessReferenceConfig emit reference config load event

func LoadProcessServiceConfig added in v1.5.8

func LoadProcessServiceConfig(url *common.URL, event string, errMsg *string)

LoadProcessServiceConfig emit service config load event

func RemoveConfigLoadProcessor added in v1.5.8

func RemoveConfigLoadProcessor(name string)

RemoveConfigLoadProcessor remove process from processors.

func RemoveConfigPostProcessor added in v1.5.7

func RemoveConfigPostProcessor(name string)

RemoveConfigPostProcessor remove process from processors.

func ResetURL added in v1.5.8

func ResetURL()

ResetURL remove all URL

func SetAccesskeyStorages added in v1.4.0

func SetAccesskeyStorages(name string, fcn func() filter.AccessKeyStorage)

SetAccesskeyStorages will set the @fcn into map with this name

func SetAndInitGlobalDispatcher added in v1.5.0

func SetAndInitGlobalDispatcher(name string)

SetAndInitGlobalDispatcher will actually init the global dispatcher if there is already a global dispatcher, it will be override if the dispatcher with the name not found, it will panic

func SetAuthenticator added in v1.4.0

func SetAuthenticator(name string, fcn func() filter.Authenticator)

SetAuthenticator puts the @fcn into map with name

func SetCluster

func SetCluster(name string, fcn func() cluster.Cluster)

SetCluster sets the cluster fault-tolerant mode with @name For example: available/failfast/broadcast/failfast/failsafe/...

func SetClusterInterceptor added in v1.5.7

func SetClusterInterceptor(name string, fun func() cluster.Interceptor)

SetClusterInterceptor sets cluster interceptor so that user has chance to inject extra logics before and after cluster invoker

func SetConfigCenter

func SetConfigCenter(name string, v func(*common.URL) (config_center.DynamicConfiguration, error))

SetConfigCenter sets the DynamicConfiguration with @name

func SetConfigCenterFactory

func SetConfigCenterFactory(name string, v func() config_center.DynamicConfigurationFactory)

SetConfigCenterFactory sets the DynamicConfigurationFactory with @name

func SetConfigLoadProcessor added in v1.5.8

func SetConfigLoadProcessor(name string, processor interfaces.ConfigLoadProcessor)

SetConfigLoadProcessor registers a ConfigLoadProcessor with the given name.

func SetConfigPostProcessor added in v1.5.6

func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor)

SetConfigPostProcessor registers a ConfigPostProcessor with the given name.

func SetConfigReaders added in v1.4.0

func SetConfigReaders(name string, v func() interfaces.ConfigReader)

SetConfigReaders sets a creator of config reader with @name

func SetConfigurator added in v1.2.0

func SetConfigurator(name string, v getConfiguratorFunc)

SetConfigurator sets the getConfiguratorFunc with @name

func SetDefaultConfigReader added in v1.4.0

func SetDefaultConfigReader(module, name string)

SetDefaultConfigReader sets @name for @module in default config reader

func SetDefaultConfigurator added in v1.2.0

func SetDefaultConfigurator(v getConfiguratorFunc)

SetDefaultConfigurator sets the default Configurator

func SetDefaultRegistryDirectory added in v1.5.0

func SetDefaultRegistryDirectory(v registryDirectory)

SetDefaultRegistryDirectory sets the default registryDirectory

func SetEventDispatcher added in v1.5.0

func SetEventDispatcher(name string, v func() observer.EventDispatcher)

SetEventDispatcher, actually, it doesn't really init the global dispatcher

func SetFilter

func SetFilter(name string, v func() filter.Filter)

SetFilter sets the filter extension with @name For example: hystrix/metrics/token/tracing/limit/...

func SetGlobalServiceNameMapping added in v1.5.0

func SetGlobalServiceNameMapping(nameMappingCreator ServiceNameMappingCreator)

func SetHealthChecker added in v1.5.3

func SetHealthChecker(name string, fcn func(_ *common.URL) router.HealthChecker)

SetHealthChecker sets the HealthChecker with @name

func SetLoadbalance

func SetLoadbalance(name string, fcn func() cluster.LoadBalance)

SetLoadbalance sets the loadbalance extension with @name For example: random/round_robin/consistent_hash/least_active/...

func SetMetadataReportFactory added in v1.5.0

func SetMetadataReportFactory(name string, v func() factory.MetadataReportFactory)

SetMetadataReportFactory sets the MetadataReportFactory with @name

func SetMetadataService added in v1.5.0

func SetMetadataService(msType string, creator func() (service.MetadataService, error))

SetMetadataService will store the msType => creator pair

func SetMetadataServiceProxyFactory added in v1.5.0

func SetMetadataServiceProxyFactory(name string, creator MetadataServiceProxyFactoryFunc)

SetMetadataServiceProxyFactory store the name-creator pair

func SetMetricReporter added in v1.4.0

func SetMetricReporter(name string, reporterFunc func() metrics.Reporter)

SetMetricReporter sets a reporter with the @name

func SetProtocol

func SetProtocol(name string, v func() protocol.Protocol)

SetProtocol sets the protocol extension with @name

func SetProxyFactory

func SetProxyFactory(name string, f func(...proxy.Option) proxy.ProxyFactory)

SetProxyFactory sets the ProxyFactory extension with @name

func SetRegistry

func SetRegistry(name string, v func(_ *common.URL) (registry.Registry, error))

SetRegistry sets the registry extension with @name

func SetRejectedExecutionHandler added in v1.2.0

func SetRejectedExecutionHandler(name string, creator func() filter.RejectedExecutionHandler)

SetRejectedExecutionHandler sets the RejectedExecutionHandler with @name

func SetRestClient added in v1.4.0

func SetRestClient(name string, fun func(_ *client.RestOptions) client.RestClient)

SetRestClient sets the RestClient with @name

func SetRestServer added in v1.4.0

func SetRestServer(name string, fun func() server.RestServer)

SetRestServer sets the RestServer with @name

func SetRouterFactory

func SetRouterFactory(name string, fun func() router.PriorityRouterFactory)

SetRouterFactory sets create router factory function with @name

func SetServiceDiscovery added in v1.5.0

func SetServiceDiscovery(protocol string, creator func(name string) (registry.ServiceDiscovery, error))

SetServiceDiscovery will store the @creator and @name protocol indicate the implementation, like nacos the name like nacos-1...

func SetServiceInstanceSelector added in v1.5.0

func SetServiceInstanceSelector(name string, f func() instance.ServiceInstanceSelector)

nolint

func SetTpsLimitStrategy added in v1.2.0

func SetTpsLimitStrategy(name string, creator filter.TpsLimitStrategyCreator)

SetTpsLimitStrategy sets the TpsLimitStrategyCreator with @name

func SetTpsLimiter added in v1.2.0

func SetTpsLimiter(name string, creator func() filter.TpsLimiter)

SetTpsLimiter sets the TpsLimiter with @name

Types

type MetadataServiceProxyFactoryFunc added in v1.5.0

type MetadataServiceProxyFactoryFunc func() service.MetadataServiceProxyFactory

type ServiceNameMappingCreator added in v1.5.0

type ServiceNameMappingCreator func() mapping.ServiceNameMapping

Jump to

Keyboard shortcuts

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