Documentation ¶
Index ¶
- Constants
- Variables
- func AddClusterWithRouter(clusters []v2.Cluster, routerConfig *v2.RouterConfiguration)
- func AddMsgMeta(dataId, groupId string)
- func AddOrUpdateClusterConfig(clusters []v2.Cluster)
- func AddOrUpdateClusterHost(clusterName string, hostCfg v2.Host)
- func AddOrUpdateListener(listener *v2.Listener)
- func AddOrUpdateRouterConfig(routerConfig *v2.RouterConfiguration)
- func AddPubInfo(pubInfoAdded map[string]string)
- func DefaultConfigLoad(path string) *v2.MOSNConfig
- func DelMsgMeta(dataId string)
- func DelPubInfo(serviceName string)
- func DeleteClusterHost(clusterName string, hostaddr string)
- func DumpConfig()
- func DumpConfigHandler()
- func DumpLock()
- func DumpUnlock()
- func GetConfigPath() string
- func GetListenerFilters(configs []v2.Filter) []api.ListenerFilterChainFactory
- func GetNetworkFilters(c *v2.FilterChain) []api.NetworkFilterChainFactory
- func GetStreamFilters(configs []v2.Filter) []api.StreamFilterChainFactory
- func Load(path string) *v2.MOSNConfig
- func ParseClusterConfig(clusters []v2.Cluster) ([]v2.Cluster, map[string][]v2.Host)
- func ParseListenerConfig(lc *v2.Listener, inheritListeners []net.Listener) *v2.Listener
- func ParseLogLevel(level string) log.Level
- func ParseRouterConfiguration(c *v2.FilterChain) (*v2.RouterConfiguration, error)
- func ParseServerConfig(c *v2.ServerConfig) *v2.ServerConfig
- func ParseServiceRegistry(src v2.ServiceRegistryInfo)
- func RegisterConfigLoadFunc(f ConfigLoadFunc)
- func RegisterConfigParsedListener(key ContentKey, cb ParsedCallback)
- func RegisterProtocolParser(key string) bool
- func RemoveClusterConfig(clusterNames []string)
- func ResetServiceRegistryInfo(appInfo v2.ApplicationInfo, subServiceList []string)
- func RmMqConsumers(key string)
- func SetMqConsumers(key string, consumers []string)
- func UpdateFullConfig(listeners []v2.Listener, routers []*v2.RouterConfiguration, ...)
- func UpdateMqClientKey(id, clientKey string, remove bool)
- func UpdateMqMeta(topic, meta string, remove bool)
- type ConfigLoadFunc
- type ContentKey
- type ParsedCallback
Constants ¶
const ( MinHostWeight = uint32(1) MaxHostWeight = uint32(128) DefaultMaxRequestPerConn = uint32(1024) DefaultConnBufferLimitBytes = uint32(16 * 1024) )
Variables ¶
Functions ¶
func AddClusterWithRouter ¶
func AddClusterWithRouter(clusters []v2.Cluster, routerConfig *v2.RouterConfiguration)
AddClusterWithRouter is a wrapper of AddOrUpdateCluster and AddOrUpdateRoutersConfig use this function to only dump config once
func AddOrUpdateClusterConfig ¶
AddOrUpdateClusterConfig called when add cluster config info received
func AddOrUpdateClusterHost ¶
func AddOrUpdateListener ¶ added in v0.11.0
func AddOrUpdateRouterConfig ¶
func AddOrUpdateRouterConfig(routerConfig *v2.RouterConfiguration)
AddOrUpdateRouterConfig update the router config
func AddPubInfo ¶
AddPubInfo called when add pub info received
func DefaultConfigLoad ¶
func DefaultConfigLoad(path string) *v2.MOSNConfig
func DelPubInfo ¶
func DelPubInfo(serviceName string)
DelPubInfo called when delete publish info received
func DeleteClusterHost ¶
func DumpConfig ¶
func DumpConfig()
func DumpConfigHandler ¶
func DumpConfigHandler()
DumpConfigHandler should be called in a goroutine we call it in mosn/starter with GoWithRecover, which can handle the panic information
func DumpUnlock ¶
func DumpUnlock()
func GetListenerFilters ¶ added in v0.11.0
func GetListenerFilters(configs []v2.Filter) []api.ListenerFilterChainFactory
GetListenerFilters returns a listener filter factory by filter.Type
func GetNetworkFilters ¶
func GetNetworkFilters(c *v2.FilterChain) []api.NetworkFilterChainFactory
GetNetworkFilters returns a network filter factory by filter.Type
func GetStreamFilters ¶
func GetStreamFilters(configs []v2.Filter) []api.StreamFilterChainFactory
GetStreamFilters returns a stream filter factory by filter.Type
func ParseClusterConfig ¶
ParseClusterConfig parses config data to api data, verify whether the config is valid
func ParseListenerConfig ¶
ParseListenerConfig
func ParseLogLevel ¶
func ParseRouterConfiguration ¶
func ParseRouterConfiguration(c *v2.FilterChain) (*v2.RouterConfiguration, error)
func ParseServerConfig ¶
func ParseServerConfig(c *v2.ServerConfig) *v2.ServerConfig
ParseServerConfig
func ParseServiceRegistry ¶
func ParseServiceRegistry(src v2.ServiceRegistryInfo)
func RegisterConfigLoadFunc ¶
func RegisterConfigLoadFunc(f ConfigLoadFunc)
RegisterConfigLoadFunc can replace a new config load function instead of default
func RegisterConfigParsedListener ¶
func RegisterConfigParsedListener(key ContentKey, cb ParsedCallback)
RegisterConfigParsedListener used to register ParsedCallback
func RegisterProtocolParser ¶
RegisterProtocolParser used to register parser
func RemoveClusterConfig ¶
func RemoveClusterConfig(clusterNames []string)
func ResetServiceRegistryInfo ¶
func ResetServiceRegistryInfo(appInfo v2.ApplicationInfo, subServiceList []string)
ResetServiceRegistryInfo called when reset service registry info received
func SetMqConsumers ¶
SetMqConsumers update topic consumer list
func UpdateFullConfig ¶ added in v0.11.0
func UpdateFullConfig(listeners []v2.Listener, routers []*v2.RouterConfiguration, clusters []v2.Cluster)
FIXME: all config should be changed to pointer instead of struct
func UpdateMqClientKey ¶
UpdateMqClientKey update mq client registry info
func UpdateMqMeta ¶
UpdteMqMeta update mq meta info
Types ¶
type ConfigLoadFunc ¶
type ConfigLoadFunc func(path string) *v2.MOSNConfig
ConfigLoadFunc parse a input(usually file path) into a mosn config
type ContentKey ¶
type ContentKey string
const ( ParseCallbackKeyCluster ContentKey = "clusters" ParseCallbackKeyServiceRgtInfo ContentKey = "service_registry" ParseCallbackKeyProcessor ContentKey = "processor" )
Group of ContentKey notes: configcontentkey equals to the key of config file
type ParsedCallback ¶
ParsedCallback is an alias for closure func(data interface{}, endParsing bool) error