Documentation ¶
Index ¶
- Constants
- func AddClusterWithRouter(listenername string, clusters []v2.Cluster, ...)
- func AddMsgMeta(dataId, groupId string)
- func AddOrUpdateClusterConfig(clusters []v2.Cluster)
- func AddOrUpdateRouterConfig(listenername string, routerConfig *v2.RouterConfiguration)
- func AddOrUpdateStreamFilters(listenername string, typ string, cfg map[string]interface{})
- func AddPubInfo(pubInfoAdded map[string]string)
- func DelMsgMeta(dataId string)
- func DelPubInfo(serviceName string)
- func DumpConfig()
- func DumpConfigHandler()
- func DumpLock()
- func DumpUnlock()
- func GetConfigPath() string
- func GetNetworkFilters(c *v2.FilterChain) []types.NetworkFilterChainFactory
- func GetStreamFilters(configs []v2.Filter) []types.StreamFilterChainFactory
- func ParseClusterConfig(clusters []v2.Cluster) ([]v2.Cluster, map[string][]v2.Host)
- func ParseFaultInjectFilter(cfg map[string]interface{}) *v2.FaultInject
- func ParseHealthCheckFilter(cfg map[string]interface{}) *v2.HealthCheckFilter
- func ParseListenerConfig(lc *v2.Listener, inheritListeners []net.Listener) *v2.Listener
- func ParseLogLevel(level string) log.Level
- func ParseMixerFilter(cfg map[string]interface{}) *v2.Mixer
- func ParseProxyFilter(cfg map[string]interface{}) *v2.Proxy
- func ParseRouterConfiguration(c *v2.FilterChain) *v2.RouterConfiguration
- func ParseServerConfig(c *v2.ServerConfig) *v2.ServerConfig
- func ParseServiceRegistry(src v2.ServiceRegistryInfo)
- func ParseStreamFaultInjectFilter(cfg map[string]interface{}) (*v2.StreamFaultInject, error)
- func ParseStreamPayloadLimitFilter(cfg map[string]interface{}) (*v2.StreamPayloadLimit, error)
- func ParseTCPProxy(cfg map[string]interface{}) (*v2.TCPProxy, error)
- 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 UpdateMqClientKey(id, clientKey string, remove bool)
- func UpdateMqMeta(topic, meta string, remove bool)
- type ClusterManagerConfig
- type ClusterManagerConfigJson
- type ConfigLoadFunc
- type ContentKey
- type MOSNConfig
- type MetricsConfig
- type Mode
- type PProfConfig
- type ParsedCallback
- type TracingConfig
Constants ¶
const ( MinHostWeight = uint32(1) MaxHostWeight = uint32(128) DefaultMaxRequestPerConn = uint32(1024) DefaultConnBufferLimitBytes = uint32(16 * 1024) )
Variables ¶
This section is empty.
Functions ¶
func AddClusterWithRouter ¶
func AddClusterWithRouter(listenername string, 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 AddOrUpdateRouterConfig ¶
func AddOrUpdateRouterConfig(listenername string, routerConfig *v2.RouterConfiguration)
AddOrUpdateRouterConfig update the connection_manager's config
func AddOrUpdateStreamFilters ¶
AddOrUpdateStreamFilters update the stream filters config
func AddPubInfo ¶
AddPubInfo called when add pub info received
func DelPubInfo ¶
func DelPubInfo(serviceName string)
DelPubInfo called when delete publish info received
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 GetNetworkFilters ¶
func GetNetworkFilters(c *v2.FilterChain) []types.NetworkFilterChainFactory
GetNetworkFilters returns a network filter factory by filter.Type
func GetStreamFilters ¶
func GetStreamFilters(configs []v2.Filter) []types.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 ParseFaultInjectFilter ¶
func ParseFaultInjectFilter(cfg map[string]interface{}) *v2.FaultInject
ParseFaultInjectFilter
func ParseHealthCheckFilter ¶
func ParseHealthCheckFilter(cfg map[string]interface{}) *v2.HealthCheckFilter
ParseHealthCheckFilter
func ParseListenerConfig ¶
ParseListenerConfig
func ParseLogLevel ¶
func ParseMixerFilter ¶
ParseMixerFilter
func ParseProxyFilter ¶
ParseProxyFilter
func ParseRouterConfiguration ¶
func ParseRouterConfiguration(c *v2.FilterChain) *v2.RouterConfiguration
ParseRouterConfiguration used to get virtualhosts from filter
func ParseServerConfig ¶
func ParseServerConfig(c *v2.ServerConfig) *v2.ServerConfig
ParseServerConfig
func ParseServiceRegistry ¶
func ParseServiceRegistry(src v2.ServiceRegistryInfo)
func ParseStreamFaultInjectFilter ¶
func ParseStreamFaultInjectFilter(cfg map[string]interface{}) (*v2.StreamFaultInject, error)
ParseStreamFaultInjectFilter
func ParseStreamPayloadLimitFilter ¶
func ParseStreamPayloadLimitFilter(cfg map[string]interface{}) (*v2.StreamPayloadLimit, error)
ParseStreamPayloadLimitFilter
func ParseTCPProxy ¶
ParseTCPProxy
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 UpdateMqClientKey ¶
UpdateMqClientKey update mq client registry info
func UpdateMqMeta ¶
UpdteMqMeta update mq meta info
Types ¶
type ClusterManagerConfig ¶
type ClusterManagerConfig struct { ClusterManagerConfigJson Clusters []v2.Cluster `json:"-"` }
ClusterManagerConfig for making up cluster manager Cluster is the global cluster of mosn
func (ClusterManagerConfig) MarshalJSON ¶
func (cc ClusterManagerConfig) MarshalJSON() (b []byte, err error)
Marshal memory config into json, if dynamic mode is configured, write json file
func (*ClusterManagerConfig) UnmarshalJSON ¶
func (cc *ClusterManagerConfig) UnmarshalJSON(b []byte) error
type ClusterManagerConfigJson ¶
type ClusterManagerConfigJson struct { // Note: consider to use standard configure AutoDiscovery bool `json:"auto_discovery,omitempty"` // Note: this is a hack method to realize cluster's health check which push by registry RegistryUseHealthCheck bool `json:"registry_use_health_check,omitempty"` ClusterConfigPath string `json:"clusters_configs,omitempty"` ClustersJson []v2.Cluster `json:"clusters,omitempty"` }
type ConfigLoadFunc ¶
type ConfigLoadFunc func(path string) *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 MOSNConfig ¶
type MOSNConfig struct { Servers []v2.ServerConfig `json:"servers,omitempty"` //server config ClusterManager ClusterManagerConfig `json:"cluster_manager,omitempty"` //cluster config ServiceRegistry v2.ServiceRegistryInfo `json:"service_registry"` //service registry config, used by service discovery module //tracing config Tracing TracingConfig `json:"tracing"` Metrics MetricsConfig `json:"metrics"` RawDynamicResources json.RawMessage `json:"dynamic_resources,omitempty"` //dynamic_resources raw message RawStaticResources json.RawMessage `json:"static_resources,omitempty"` //static_resources raw message RawAdmin json.RawMessage `json:"admin,omitempty"` // admin raw message Debug PProfConfig `json:"pprof,omitempty"` Pid string `json:"pid,omitempty"` // pid file }
MOSNConfig make up mosn to start the mosn project Servers contains the listener, filter and so on ClusterManager used to manage the upstream
func DefaultConfigLoad ¶
func DefaultConfigLoad(path string) *MOSNConfig
func (*MOSNConfig) GetAdmin ¶
func (c *MOSNConfig) GetAdmin() *xdsboot.Admin
func (*MOSNConfig) Mode ¶
func (c *MOSNConfig) Mode() Mode
type MetricsConfig ¶
type MetricsConfig struct { SinkConfigs []v2.Filter `json:"sinks"` StatsMatcher v2.StatsMatcher `json:"stats_matcher"` ShmZone string `json:"shm_zone"` ShmSize datasize.ByteSize `json:"shm_size"` }
MetricsConfig for metrics sinks
type PProfConfig ¶
type PProfConfig struct { StartDebug bool `json:"debug"` // If StartDebug is true, start a pprof, default is false Port int `json:"port_value"` // If port value is 0, will use 9090 as default }
PProfConfig is used to start a pprof server for debug
type ParsedCallback ¶
ParsedCallback is an alias for closure func(data interface{}, endParsing bool) error