extension

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 23 Imported by: 32

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 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 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 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 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 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 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 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 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 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