configmanager

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CfgTypeMOSN     = "MOSN"
	CfgTypeRouter   = "Router"
	CfgTypeCluster  = "Cluster"
	CfgTypeListener = "Listener"
	CfgTypeExtend   = "Extend"
)
View Source
const (
	MinHostWeight               = uint32(1)
	MaxHostWeight               = uint32(128)
	DefaultMaxRequestPerConn    = uint32(1024)
	DefaultConnBufferLimitBytes = uint32(16 * 1024)
)
View Source
const ConfigAutoWrite featuregate.Feature = "auto_config"

Variables

This section is empty.

Functions

func AddClusterWithRouter

func AddClusterWithRouter(_ []v2.Cluster, _ *v2.RouterConfiguration)

func AddOrUpdateClusterConfig deprecated

func AddOrUpdateClusterConfig(_ []v2.Cluster)

Deprecated: these functions should not be called. we keep these functions just for compatiable. If dump config is needed, use featuregate: auto_config to dump automatically

func AddOrUpdateClusterHost

func AddOrUpdateClusterHost(_ string, _ v2.Host)

func AddOrUpdateListener added in v0.11.0

func AddOrUpdateListener(_ *v2.Listener)

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 DeleteClusterHost(_ string, _ string)

func DumpConfig

func DumpConfig()

DumpConfig writes the config into config path file

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 DumpJSON added in v0.18.0

func DumpJSON() ([]byte, error)

DumpJSON marshals the effectiveConfig to bytes

func DumpLock

func DumpLock()

func DumpUnlock

func DumpUnlock()

func GetAddrIp added in v0.15.0

func GetAddrIp(addr net.Addr) net.IP

func GetAddrPort added in v0.15.0

func GetAddrPort(addr net.Addr) int

func GetConfigPath

func GetConfigPath() string

protetced configPath, read only

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

func InheritMosnconfig() ([]byte, error)

InheritMosnconfig get old mosn configs

func Load

func Load(path string) *v2.MOSNConfig

Load config file and parse

func ParseClusterConfig

func ParseClusterConfig(clusters []v2.Cluster) ([]v2.Cluster, map[string][]v2.Host)

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 ParseLogLevel(level string) log.Level

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 Reset added in v0.18.0

func Reset()

func SetClusterConfig added in v0.18.0

func SetClusterConfig(cluster v2.Cluster)

SetClusterConfig update the cluster config when AddOrUpdateCluster

func SetClusterManagerTLS added in v0.18.0

func SetClusterManagerTLS(tls v2.TLSConfig)

func SetExtend added in v0.18.0

func SetExtend(typ string, cfg json.RawMessage)

func SetHosts added in v0.18.0

func SetHosts(clusterName string, hostConfigs []v2.Host)

func SetListenerConfig added in v0.18.0

func SetListenerConfig(listenerConfig v2.Listener)

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

func UpdateClusterManagerTLS(_ v2.TLSConfig)

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

type ParsedCallback func(data interface{}, endParsing bool) error

ParsedCallback is an alias for closure func(data interface{}, endParsing bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL