extension

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddCustomShutdownCallback

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

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 GetAccessKeyStorages

func GetAccessKeyStorages(name string) filter.AccessKeyStorage

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

func GetAllCustomShutdownCallbacks

func GetAllCustomShutdownCallbacks() *list.List

GetAllCustomShutdownCallbacks gets all custom shutdown callbacks

func GetAuthenticator

func GetAuthenticator(name string) (filter.Authenticator, bool)

GetAuthenticator finds the Authenticator with @name Panic if not found

func GetCluster

func GetCluster(name string) (cluster.Cluster, error)

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, error)

GetConfigCenterFactory finds the DynamicConfigurationFactory with @name

func GetConfigPostProcessor

func GetConfigPostProcessor(name string) interfaces.ConfigPostProcessor

GetConfigPostProcessor finds a ConfigPostProcessor by name.

func GetConfigPostProcessors

func GetConfigPostProcessors() []interfaces.ConfigPostProcessor

GetConfigPostProcessors returns all registered instances of ConfigPostProcessor.

func GetConfigReaders

func GetConfigReaders(name string) interfaces.ConfigReader

GetConfigReaders gets a config reader with @name

func GetConfigurator

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

GetConfigurator finds the Configurator with @name

func GetCustomizers

func GetCustomizers() []registry.ServiceInstanceCustomizer

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

func GetDefaultConfigReader

func GetDefaultConfigReader() map[string]string

GetDefaultConfigReader gets default config reader

func GetDefaultConfigurator

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

GetDefaultConfigurator gets default configurator

func GetDefaultConfiguratorFunc

func GetDefaultConfiguratorFunc() getConfiguratorFunc

GetDefaultConfiguratorFunc gets default configurator function

func GetDefaultRegistryDirectory

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

GetDefaultRegistryDirectory finds the registryDirectory with url and registry

func GetFilter

func GetFilter(name string) (filter.Filter, bool)

GetFilter finds the filter extension with @name

func GetGlobalServiceNameMapping

func GetGlobalServiceNameMapping() mapping.ServiceNameMapping

func GetLoadbalance

func GetLoadbalance(name string) loadbalance.LoadBalance

GetLoadbalance finds the loadbalance extension with @name

func GetLocalMetadataService

func GetLocalMetadataService(key string) (service.MetadataService, error)

GetMetadataService will create a local MetadataService instance

func GetMetadataReportFactory

func GetMetadataReportFactory(name string) factory.MetadataReportFactory

GetMetadataReportFactory finds the MetadataReportFactory with @name

func GetMetadataServiceExporter

func GetMetadataServiceExporter(key string, s service.MetadataService) exporter.MetadataServiceExporter

GetMetadataServiceExporter will create a MetadataServiceExporter instance

func GetMetadataServiceProxyFactory

func GetMetadataServiceProxyFactory(name string) service.MetadataServiceProxyFactory

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

func GetMetricReporter

func GetMetricReporter(name string, config *metrics.ReporterConfig) 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

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

GetNewRestClient finds the RestClient with @name

func GetNewRestServer

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

func GetRejectedExecutionHandler(name string) (filter.RejectedExecutionHandler, error)

GetRejectedExecutionHandler finds the RejectedExecutionHandler with @name

func GetRemoteMetadataService

func GetRemoteMetadataService() (service.RemoteMetadataService, error)

GetRemoteMetadataService will create a MetadataService instance

func GetRouterFactories

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

func GetServiceDiscovery(url *common.URL) (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

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

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

func GetTpsLimitStrategyCreator

func GetTpsLimitStrategyCreator(name string) (filter.TpsLimitStrategyCreator, error)

GetTpsLimitStrategyCreator finds the TpsLimitStrategyCreator with @name

func GetTpsLimiter

func GetTpsLimiter(name string) (filter.TpsLimiter, error)

GetTpsLimiter finds the TpsLimiter with @name

func SetAccessKeyStorages

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

SetAccessKeyStorages will set the @fcn into map with this name

func SetAuthenticator

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 SetConfig

func SetConfig(c Config)

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 SetConfigPostProcessor

func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor)

SetConfigPostProcessor registers a ConfigPostProcessor with the given name.

func SetConfigReaders

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

SetConfigReaders sets a creator of config reader with @name

func SetConfigurator

func SetConfigurator(name string, v getConfiguratorFunc)

SetConfigurator sets the getConfiguratorFunc with @name

func SetDefaultConfigReader

func SetDefaultConfigReader(module, name string)

SetDefaultConfigReader sets @name for @module in default config reader

func SetDefaultConfigurator

func SetDefaultConfigurator(v getConfiguratorFunc)

SetDefaultConfigurator sets the default Configurator

func SetDefaultRegistryDirectory

func SetDefaultRegistryDirectory(v registryDirectory)

SetDefaultRegistryDirectory sets the default registryDirectory

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

func SetGlobalServiceNameMapping(nameMappingCreator ServiceNameMappingCreator)

func SetLoadbalance

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

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

func SetLocalMetadataService

func SetLocalMetadataService(key string, creator localMetadataServiceCreator)

SetLocalMetadataService will store the msType => creator pair

func SetMetadataReportFactory

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

SetMetadataReportFactory sets the MetadataReportFactory with @name

func SetMetadataServiceExporter

func SetMetadataServiceExporter(key string, creator MetadataServiceExporterCreator)

SetMetadataServiceExporter will store the type => creator pair

func SetMetadataServiceProxyFactory

func SetMetadataServiceProxyFactory(name string, creator MetadataServiceProxyFactoryFunc)

SetMetadataServiceProxyFactory store the name-creator pair

func SetMetricReporter

func SetMetricReporter(name string, reporterFunc func(config *metrics.ReporterConfig) 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

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

SetRejectedExecutionHandler sets the RejectedExecutionHandler with @name

func SetRemoteMetadataService

func SetRemoteMetadataService(creatorFunc remoteMetadataServiceCreator)

SetRemoteMetadataService will store the remote metadata service

func SetRestClient

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

SetRestClient sets the RestClient with @name

func SetRestServer

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

func SetServiceDiscovery(protocol string, creator func(url *common.URL) (registry.ServiceDiscovery, error))

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

func SetServiceInstanceSelector

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

nolint

func SetTpsLimitStrategy

func SetTpsLimitStrategy(name string, creator filter.TpsLimitStrategyCreator)

SetTpsLimitStrategy sets the TpsLimitStrategyCreator with @name

func SetTpsLimiter

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

SetTpsLimiter sets the TpsLimiter with @name

Types

type Config

type Config interface {
	Prefix() string
}

type MetadataServiceProxyFactoryFunc

type MetadataServiceProxyFactoryFunc func() service.MetadataServiceProxyFactory

type ServiceNameMappingCreator

type ServiceNameMappingCreator func() mapping.ServiceNameMapping

Jump to

Keyboard shortcuts

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