Documentation ¶
Index ¶
- Constants
- func AddClusterWithRouter(_ []v2.Cluster, _ *v2.RouterConfiguration)
- func AddOrUpdateClusterConfig(_ []v2.Cluster)deprecated
- func AddOrUpdateClusterHost(_ string, _ v2.Host)
- func AddOrUpdateListener(_ *v2.Listener)
- func AddOrUpdateListenerFilterFactories(listenerName string, configs []v2.Filter) []api.ListenerFilterChainFactory
- func AddOrUpdateNetworkFilterFactories(listenerName string, ln *v2.Listener) []api.NetworkFilterChainFactory
- func AddOrUpdateRouterConfig(_ *v2.RouterConfiguration)
- func DefaultConfigLoad(path string) *v2.MOSNConfig
- func DeleteClusterHost(_ string, _ string)
- func DumpConfig()
- func DumpConfigHandler()
- func DumpJSON() ([]byte, error)
- func DumpLock()
- func DumpUnlock()
- func GetAddrIp(addr net.Addr) net.IP
- func GetAddrPort(addr net.Addr) int
- func GetConfigPath() string
- func GetListenerFilterFactories(listenerName string) []api.ListenerFilterChainFactory
- func GetNetworkFilterFactories(listenerName string) []api.NetworkFilterChainFactory
- func HandleMOSNConfig(typ string, handle func(interface{}))
- func InheritMosnconfig() ([]byte, error)
- 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 RegisterConfigLoadFunc(f ConfigLoadFunc)
- func RegisterConfigParsedListener(key ContentKey, cb ParsedCallback)
- func RegisterTransferExtension(f func(*v2.MOSNConfig))
- func RemoveClusterConfig(_ []string)
- func Reset()
- func SetClusterConfig(cluster v2.Cluster)
- func SetClusterManagerTLS(tls v2.TLSConfig)
- func SetExtend(typ string, cfg json.RawMessage)
- func SetHosts(clusterName string, hostConfigs []v2.Host)
- func SetListenerConfig(listenerConfig v2.Listener)
- func SetMosnConfig(cfg *v2.MOSNConfig)
- func SetRemoveClusterConfig(clusterName string)
- func SetRouter(router v2.RouterConfiguration)
- func UpdateClusterManagerTLS(_ v2.TLSConfig)
- type ConfigAutoFeature
- type ConfigLoadFunc
- type ContentKey
- type ParsedCallback
Constants ¶
const ( CfgTypeMOSN = "MOSN" CfgTypeRouter = "Router" CfgTypeCluster = "Cluster" CfgTypeListener = "Listener" CfgTypeExtend = "Extend" )
const ( MinHostWeight = uint32(1) MaxHostWeight = uint32(128) DefaultMaxRequestPerConn = uint32(1024) DefaultConnBufferLimitBytes = uint32(16 * 1024) )
const ConfigAutoWrite featuregate.Feature = "auto_config"
Variables ¶
This section is empty.
Functions ¶
func AddClusterWithRouter ¶
func AddClusterWithRouter(_ []v2.Cluster, _ *v2.RouterConfiguration)
func AddOrUpdateClusterConfig
deprecated
func AddOrUpdateClusterHost ¶
func AddOrUpdateListener ¶ added in v0.11.0
func AddOrUpdateListenerFilterFactories ¶ added in v0.25.0
func AddOrUpdateListenerFilterFactories(listenerName string, configs []v2.Filter) []api.ListenerFilterChainFactory
AddOrUpdateListenerFilterFactories adds or updates the listener filter factories of a listener
func AddOrUpdateNetworkFilterFactories ¶ added in v0.25.0
func AddOrUpdateNetworkFilterFactories(listenerName string, ln *v2.Listener) []api.NetworkFilterChainFactory
AddOrUpdateNetworkFilterFactories adds or updates the network filter factories of a listener
func AddOrUpdateRouterConfig ¶
func AddOrUpdateRouterConfig(_ *v2.RouterConfiguration)
func DefaultConfigLoad ¶
func DefaultConfigLoad(path string) *v2.MOSNConfig
func DeleteClusterHost ¶
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 GetAddrPort ¶ added in v0.15.0
func GetListenerFilterFactories ¶ added in v0.25.0
func GetListenerFilterFactories(listenerName string) []api.ListenerFilterChainFactory
GetListenerFilterFactories returns a listener filter factory by filter.Type
func GetNetworkFilterFactories ¶ added in v0.25.0
func GetNetworkFilterFactories(listenerName string) []api.NetworkFilterChainFactory
GetNetworkFilterFactories returns a network filter factory by filter.Type
func HandleMOSNConfig ¶ added in v0.18.0
func HandleMOSNConfig(typ string, handle func(interface{}))
func InheritMosnconfig ¶ added in v0.20.0
InheritMosnconfig get old mosn configs
func ParseClusterConfig ¶
ParseClusterConfig parses config data to api data, verify whether the config is valid
func ParseListenerConfig ¶
func ParseListenerConfig(lc *v2.Listener, inheritListeners []net.Listener, inheritPacketConn []net.PacketConn) *v2.Listener
ParseListenerConfig
func ParseLogLevel ¶
func ParseRouterConfiguration ¶
func ParseRouterConfiguration(c *v2.FilterChain) (*v2.RouterConfiguration, error)
func ParseServerConfig ¶
func ParseServerConfig(c *v2.ServerConfig) *v2.ServerConfig
ParseServerConfig
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 RegisterTransferExtension ¶ added in v0.18.0
func RegisterTransferExtension(f func(*v2.MOSNConfig))
RegisterTransferExtension regists the transferExtensionFunc. this function should be called before dump goroutine is started.
func RemoveClusterConfig ¶
func RemoveClusterConfig(_ []string)
func SetClusterConfig ¶ added in v0.18.0
SetClusterConfig update the cluster config when AddOrUpdateCluster
func SetClusterManagerTLS ¶ added in v0.18.0
func SetExtend ¶ added in v0.18.0
func SetExtend(typ string, cfg json.RawMessage)
func SetListenerConfig ¶ added in v0.18.0
SetListenerConfig update the listener config when AddOrUpdateListener
func SetMosnConfig ¶ added in v0.18.0
func SetMosnConfig(cfg *v2.MOSNConfig)
func SetRemoveClusterConfig ¶ added in v0.18.0
func SetRemoveClusterConfig(clusterName string)
SetRemoveClusterConfig update the cluster config when DeleteCluster
func SetRouter ¶ added in v0.18.0
func SetRouter(router v2.RouterConfiguration)
func UpdateClusterManagerTLS ¶ added in v0.16.0
Types ¶
type ConfigAutoFeature ¶ added in v0.18.0
type ConfigAutoFeature struct {
featuregate.BaseFeatureSpec
}
ConfigAutoFeature controls xDS update config will overwrite config file or not, default is not
func (*ConfigAutoFeature) InitFunc ¶ added in v0.18.0
func (f *ConfigAutoFeature) InitFunc()
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" 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