configmanager

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

View Source
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 AddMsgMeta

func AddMsgMeta(dataId, groupId string)

AddMsgMeta called when msg meta updated

func AddOrUpdateClusterConfig

func AddOrUpdateClusterConfig(clusters []v2.Cluster)

AddOrUpdateClusterConfig called when add cluster config info received

func AddOrUpdateClusterHost

func AddOrUpdateClusterHost(clusterName string, hostCfg v2.Host)

func AddOrUpdateListener added in v0.11.0

func AddOrUpdateListener(listener *v2.Listener)

func AddOrUpdateRouterConfig

func AddOrUpdateRouterConfig(routerConfig *v2.RouterConfiguration)

AddOrUpdateRouterConfig update the router config

func AddPubInfo

func AddPubInfo(pubInfoAdded map[string]string)

AddPubInfo called when add pub info received

func DefaultConfigLoad

func DefaultConfigLoad(path string) *v2.MOSNConfig

func DelMsgMeta

func DelMsgMeta(dataId string)

DelMsgMeta called when delete msg meta received

func DelPubInfo

func DelPubInfo(serviceName string)

DelPubInfo called when delete publish info received

func DeleteClusterHost

func DeleteClusterHost(clusterName string, hostaddr string)

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 DumpLock

func DumpLock()

func DumpUnlock

func DumpUnlock()

func GetConfigPath

func GetConfigPath() string

protetced configPath, read only

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 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) *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 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

func RegisterProtocolParser(key string) bool

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 RmMqConsumers

func RmMqConsumers(key string)

RmMqConsumers remove topic consumer list

func SetMqConsumers

func SetMqConsumers(key string, consumers []string)

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

func UpdateMqClientKey(id, clientKey string, remove bool)

UpdateMqClientKey update mq client registry info

func UpdateMqMeta

func UpdateMqMeta(topic, meta string, remove bool)

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

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