Documentation ¶
Index ¶
- Constants
- func AddCustomShutdownCallback(callback func())
- func AddCustomizers(cus registry.ServiceInstanceCustomizer)
- func AddEventListener(creator func() observer.EventListener)
- func GetAccesskeyStorages(name string) filter.AccessKeyStorage
- func GetAllCustomShutdownCallbacks() *list.List
- func GetAuthenticator(name string) filter.Authenticator
- func GetCluster(name string) cluster.Cluster
- func GetConfigCenter(name string, config *common.URL) (config_center.DynamicConfiguration, error)
- func GetConfigCenterFactory(name string) config_center.DynamicConfigurationFactory
- 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) (cluster.Directory, error)
- func GetFileRouterFactories() map[string]router.FilePriorityRouterFactory
- func GetFilter(name string) filter.Filter
- func GetGlobalDispatcher() observer.EventDispatcher
- func GetGlobalServiceNameMapping() mapping.ServiceNameMapping
- func GetHealthChecker(name string, url *common.URL) router.HealthChecker
- func GetLoadbalance(name string) cluster.LoadBalance
- func GetMetadataReportFactory(name string) factory.MetadataReportFactory
- func GetMetadataService(msType string) (service.MetadataService, error)
- func GetMetadataServiceProxyFactory(name string) service.MetadataServiceProxyFactory
- func GetMetricReporter(name string) 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
- func GetRouterFactories() map[string]func() router.PriorityRouterFactory
- func GetRouterFactory(name string) router.PriorityRouterFactory
- func GetServiceDiscovery(protocol string, name string) (registry.ServiceDiscovery, error)
- func GetServiceInstanceSelector(name string) (instance.ServiceInstanceSelector, error)
- func GetTpsLimitStrategyCreator(name string) filter.TpsLimitStrategyCreator
- func GetTpsLimiter(name string) filter.TpsLimiter
- func SetAccesskeyStorages(name string, fcn func() filter.AccessKeyStorage)
- func SetAndInitGlobalDispatcher(name string)
- func SetAuthenticator(name string, fcn func() filter.Authenticator)
- func SetCluster(name string, fcn func() cluster.Cluster)
- func SetConfigCenter(name string, v func(*common.URL) (config_center.DynamicConfiguration, error))
- func SetConfigCenterFactory(name string, v func() config_center.DynamicConfigurationFactory)
- 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 SetEventDispatcher(name string, v func() observer.EventDispatcher)
- func SetFilter(name string, v func() filter.Filter)
- func SetGlobalServiceNameMapping(nameMappingCreator ServiceNameMappingCreator)
- func SetHealthChecker(name string, fcn func(_ *common.URL) router.HealthChecker)
- func SetLoadbalance(name string, fcn func() cluster.LoadBalance)
- func SetMetadataReportFactory(name string, v func() factory.MetadataReportFactory)
- func SetMetadataService(msType string, creator func() (service.MetadataService, error))
- func SetMetadataServiceProxyFactory(name string, creator MetadataServiceProxyFactoryFunc)
- func SetMetricReporter(name string, reporterFunc func() metrics.Reporter)
- 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 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, creator func(name string) (registry.ServiceDiscovery, error))
- func SetServiceInstanceSelector(name string, f func() instance.ServiceInstanceSelector)
- func SetTpsLimitStrategy(name string, creator filter.TpsLimitStrategyCreator)
- func SetTpsLimiter(name string, creator func() filter.TpsLimiter)
- type MetadataServiceProxyFactoryFunc
- type ServiceNameMappingCreator
Constants ¶
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
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 ¶
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
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 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
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 ¶
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 ¶ 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 ¶
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 ¶
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
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 ¶ 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
Source Files ¶
- auth.go
- cluster.go
- config_center.go
- config_center_factory.go
- config_reader.go
- configurator.go
- event_dispatcher.go
- filter.go
- graceful_shutdown.go
- health_checker.go
- loadbalance.go
- metadata_report_factory.go
- metadata_service.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