Documentation ¶
Index ¶
- Constants
- func AddCustomShutdownCallback(callback func())
- func AddCustomizers(cus registry.ServiceInstanceCustomizer)
- func GetAccessKeyStorages(name string) filter.AccessKeyStorage
- func GetAllCustomShutdownCallbacks() *list.List
- func GetAuthenticator(name string) (filter.Authenticator, bool)
- func GetCluster(name string) (cluster.Cluster, error)
- func GetConfigCenter(name string, config *common.URL) (config_center.DynamicConfiguration, error)
- func GetConfigCenterFactory(name string) (config_center.DynamicConfigurationFactory, error)
- func GetConfigPostProcessor(name string) interfaces.ConfigPostProcessor
- func GetConfigPostProcessors() []interfaces.ConfigPostProcessor
- func GetConfigReaders(name string) interfaces.ConfigReader
- func GetConfigurator(name string, url *common.URL) config_center.Configurator
- func GetCustomizers() []registry.ServiceInstanceCustomizer
- func GetDefaultConfigReader() map[string]string
- func GetDefaultConfigurator(url *common.URL) config_center.Configurator
- func GetDefaultConfiguratorFunc() getConfiguratorFunc
- func GetDefaultRegistryDirectory(config *common.URL, registry registry.Registry) (directory.Directory, error)
- func GetFilter(name string) (filter.Filter, bool)
- func GetGlobalServiceNameMapping() mapping.ServiceNameMapping
- func GetLoadbalance(name string) loadbalance.LoadBalance
- func GetLocalMetadataService(key string) (service.MetadataService, error)
- func GetMetadataReportFactory(name string) factory.MetadataReportFactory
- func GetMetadataServiceExporter(key string, s service.MetadataService) exporter.MetadataServiceExporter
- func GetMetadataServiceProxyFactory(name string) service.MetadataServiceProxyFactory
- func GetMetricReporter(name string, config *metrics.ReporterConfig) metrics.Reporter
- func GetNewRestClient(name string, restOptions *client.RestOptions) client.RestClient
- func GetNewRestServer(name string) server.RestServer
- func GetProtocol(name string) protocol.Protocol
- func GetProxyFactory(name string) proxy.ProxyFactory
- func GetRegistry(name string, config *common.URL) (registry.Registry, error)
- func GetRejectedExecutionHandler(name string) (filter.RejectedExecutionHandler, error)
- func GetRemoteMetadataService() (service.RemoteMetadataService, error)
- func GetRouterFactories() map[string]func() router.PriorityRouterFactory
- func GetRouterFactory(name string) router.PriorityRouterFactory
- func GetServiceDiscovery(url *common.URL) (registry.ServiceDiscovery, error)
- func GetServiceInstanceSelector(name string) (instance.ServiceInstanceSelector, error)
- func GetTpsLimitStrategyCreator(name string) (filter.TpsLimitStrategyCreator, error)
- func GetTpsLimiter(name string) (filter.TpsLimiter, error)
- func SetAccessKeyStorages(name string, fcn func() filter.AccessKeyStorage)
- func SetAuthenticator(name string, fcn func() filter.Authenticator)
- func SetCluster(name string, fcn func() cluster.Cluster)
- func SetConfig(c Config)
- func SetConfigCenter(name string, v func(*common.URL) (config_center.DynamicConfiguration, error))
- func SetConfigCenterFactory(name string, v func() config_center.DynamicConfigurationFactory)
- func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor)
- func SetConfigReaders(name string, v func() interfaces.ConfigReader)
- func SetConfigurator(name string, v getConfiguratorFunc)
- func SetDefaultConfigReader(module, name string)
- func SetDefaultConfigurator(v getConfiguratorFunc)
- func SetDefaultRegistryDirectory(v registryDirectory)
- func SetFilter(name string, v func() filter.Filter)
- func SetGlobalServiceNameMapping(nameMappingCreator ServiceNameMappingCreator)
- func SetLoadbalance(name string, fcn func() loadbalance.LoadBalance)
- func SetLocalMetadataService(key string, creator localMetadataServiceCreator)
- func SetMetadataReportFactory(name string, v func() factory.MetadataReportFactory)
- func SetMetadataServiceExporter(key string, creator MetadataServiceExporterCreator)
- func SetMetadataServiceProxyFactory(name string, creator MetadataServiceProxyFactoryFunc)
- func SetMetricReporter(name string, ...)
- func SetProtocol(name string, v func() protocol.Protocol)
- func SetProxyFactory(name string, f func(...proxy.Option) proxy.ProxyFactory)
- func SetRegistry(name string, v func(_ *common.URL) (registry.Registry, error))
- func SetRejectedExecutionHandler(name string, creator func() filter.RejectedExecutionHandler)
- func SetRemoteMetadataService(creatorFunc remoteMetadataServiceCreator)
- func SetRestClient(name string, fun func(_ *client.RestOptions) client.RestClient)
- func SetRestServer(name string, fun func() server.RestServer)
- func SetRouterFactory(name string, fun func() router.PriorityRouterFactory)
- func SetServiceDiscovery(protocol string, ...)
- func SetServiceInstanceSelector(name string, f func() instance.ServiceInstanceSelector)
- func SetTpsLimitStrategy(name string, creator filter.TpsLimitStrategyCreator)
- func SetTpsLimiter(name string, creator func() filter.TpsLimiter)
- type Config
- type MetadataServiceExporterCreator
- type MetadataServiceProxyFactoryFunc
- type ServiceNameMappingCreator
Constants ¶
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 ¶
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 ¶
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 ¶
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 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)
GetLocalMetadataService 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 ¶
GetProtocol finds the protocol extension with @name
func GetProxyFactory ¶
func GetProxyFactory(name string) proxy.ProxyFactory
GetProxyFactory finds the ProxyFactory extension with @name
func GetRegistry ¶
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 ¶
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 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 ¶
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 ¶
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 ¶
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 MetadataServiceExporterCreator ¶
type MetadataServiceExporterCreator func(service.MetadataService) exporter.MetadataServiceExporter
type MetadataServiceProxyFactoryFunc ¶
type MetadataServiceProxyFactoryFunc func() service.MetadataServiceProxyFactory
type ServiceNameMappingCreator ¶
type ServiceNameMappingCreator func() mapping.ServiceNameMapping
Source Files ¶
- auth.go
- cluster.go
- config.go
- config_center.go
- config_center_factory.go
- config_post_processor.go
- config_reader.go
- configurator.go
- filter.go
- graceful_shutdown.go
- loadbalance.go
- metadata_remote.go
- metadata_report_factory.go
- metadata_service.go
- metadata_service_exporter.go
- metadata_service_proxy_factory.go
- metrics.go
- protocol.go
- proxy_factory.go
- registry.go
- registry_directory.go
- rest_client.go
- rest_server.go
- router_factory.go
- service_discovery.go
- service_instance_customizer.go
- service_instance_selector_factory.go
- service_name_mapping.go
- tps_limit.go