Documentation ¶
Index ¶
- func InitManager(serverType consts.ServerType, serverMode consts.ServerMode, ...) error
- type AgentConfig
- type AgentManager
- type ApiConfig
- type ApiManager
- type AppConfig
- type BuiltinRegistryConfig
- type BuiltinRegistryConfigManager
- func (cm *BuiltinRegistryConfigManager) GetDiscoveryResolver() discovery.Resolver
- func (cm *BuiltinRegistryConfigManager) GetKitexRegistry(serviceName, serviceId, addr string) (kitexregistry.Registry, *kitexregistry.Info)
- func (cm *BuiltinRegistryConfigManager) GetRegistry() registry.IRegistry
- func (cm *BuiltinRegistryConfigManager) GetRegistryType() consts.RegistryType
- type Cfg
- type Config
- type DispatcherConfig
- type FileConfig
- type IRegistryConfigManager
- type LoggerConfig
- type Manager
- type Metadata
- type Mysql
- type Redis
- type RedisCluster
- type RedisStandAlone
- type RegistryConfig
- type RpcClientConf
- type StoreConfig
- type TracerConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitManager ¶
func InitManager(serverType consts.ServerType, serverMode consts.ServerMode, configType consts.ConfigType, metadata ...interface{}) error
Types ¶
type AgentConfig ¶
type AgentConfig struct { Addr string `mapstructure:"addr"` MaxConnections int64 `mapstructure:"maxConnections"` MaxQPS int64 `mapstructure:"maxQPS"` WorkerNum int `mapstructure:"workerNum"` }
func (*AgentConfig) Init ¶
func (conf *AgentConfig) Init()
type AgentManager ¶
type AgentManager struct { RegistryConfigManager IRegistryConfigManager ServiceId string ServiceName string // contains filtered or unexported fields }
func NewAgentManager ¶
func NewAgentManager(config AgentConfig, registryConfig RegistryConfig, storeConfig StoreConfig, serviceId string) *AgentManager
func (*AgentManager) GetKitexServerOptions ¶
func (cm *AgentManager) GetKitexServerOptions() []server.Option
type ApiConfig ¶
type ApiConfig struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Tracing TracerConf `mapstructure:"tracing"` MetricsUrl string `mapstructure:"metricsUrl"` Dispatcher DispatcherConfig `mapstructure:"dispatcher"` }
type ApiManager ¶
type ApiManager struct { RegistryConfigManager IRegistryConfigManager Server *server.Hertz ServiceId string ServiceName string // contains filtered or unexported fields }
func NewApiManager ¶
func NewApiManager(config ApiConfig, registryConfig RegistryConfig, storeConfig StoreConfig, serviceId string) *ApiManager
type AppConfig ¶
type AppConfig struct { RunMode string `mapstructure:"runMode"` Timezone string `mapstructure:"timezone"` ProxyUrl string `mapstructure:"proxyUrl"` SyncAgentServiceInterval string `mapstructure:"syncAgentServiceInterval"` SyncIdlInterval string `mapstructure:"syncIdlInterval"` }
func (*AppConfig) GetSyncAgentServiceInterval ¶
func (*AppConfig) GetSyncIdlInterval ¶
type BuiltinRegistryConfig ¶
type BuiltinRegistryConfig struct {
Address string `mapstructure:"address"`
}
type BuiltinRegistryConfigManager ¶
type BuiltinRegistryConfigManager struct { Config BuiltinRegistryConfig RegistryType consts.RegistryType Registry *registry.BuiltinRegistry // contains filtered or unexported fields }
func NewBuiltinRegistryConfigManager ¶
func NewBuiltinRegistryConfigManager(config BuiltinRegistryConfig, storeConfig StoreConfig) (*BuiltinRegistryConfigManager, error)
func (*BuiltinRegistryConfigManager) GetDiscoveryResolver ¶
func (cm *BuiltinRegistryConfigManager) GetDiscoveryResolver() discovery.Resolver
func (*BuiltinRegistryConfigManager) GetKitexRegistry ¶
func (cm *BuiltinRegistryConfigManager) GetKitexRegistry(serviceName, serviceId, addr string) (kitexregistry.Registry, *kitexregistry.Info)
func (*BuiltinRegistryConfigManager) GetRegistry ¶
func (cm *BuiltinRegistryConfigManager) GetRegistry() registry.IRegistry
func (*BuiltinRegistryConfigManager) GetRegistryType ¶
func (cm *BuiltinRegistryConfigManager) GetRegistryType() consts.RegistryType
type Config ¶
type Config struct { App AppConfig `mapstructure:"app"` Logger LoggerConfig `mapstructure:"logger"` Registry RegistryConfig `mapstructure:"registry"` Store StoreConfig `mapstructure:"store"` Api ApiConfig `mapstructure:"api"` Agent AgentConfig `mapstructure:"agent"` }
type DispatcherConfig ¶
type DispatcherConfig struct {
Type string `mapstructure:"type"`
}
func (*DispatcherConfig) Init ¶
func (conf *DispatcherConfig) Init()
func (*DispatcherConfig) NewDispatcher ¶
func (conf *DispatcherConfig) NewDispatcher() dispatcher.IDispatcher
type FileConfig ¶
type FileConfig struct {
Path string
}
type IRegistryConfigManager ¶
type IRegistryConfigManager interface { GetRegistryType() consts.RegistryType GetRegistry() registry.IRegistry GetKitexRegistry(serviceName, serviceId, addr string) (kitexregistry.Registry, *kitexregistry.Info) GetDiscoveryResolver() discovery.Resolver }
type LoggerConfig ¶
type LoggerConfig struct { SavePath string `mapstructure:"savePath"` EncoderType string `mapstructure:"encoderType"` EncodeLevel string `mapstructure:"encodeLevel"` EncodeCaller string `mapstructure:"encodeCaller"` }
func (*LoggerConfig) Init ¶
func (conf *LoggerConfig) Init()
type Manager ¶
type Manager struct { ServerType consts.ServerType ServerMode consts.ServerMode ServiceId string Config Config ApiConfigManager *ApiManager AgentConfigManager *AgentManager }
func GetManager ¶
func GetManager() *Manager
type Mysql ¶
type Redis ¶
type Redis struct { Type string `mapstructure:"type"` StandAlone RedisStandAlone `mapstructure:"standalone"` Cluster RedisCluster `mapstructure:"cluster"` }
type RedisCluster ¶
type RedisStandAlone ¶
type RegistryConfig ¶
type RegistryConfig struct { Type string `mapstructure:"type"` Builtin BuiltinRegistryConfig `mapstructure:"builtin"` }
func (*RegistryConfig) Init ¶
func (conf *RegistryConfig) Init()
type RpcClientConf ¶
type StoreConfig ¶
type StoreConfig struct { Type string `mapstructure:"type"` Mysql Mysql `mapstructure:"mysql"` Redis Redis `mapstructure:"redis"` }
func (*StoreConfig) GetStoreType ¶
func (conf *StoreConfig) GetStoreType() consts.StoreType
func (*StoreConfig) Init ¶
func (conf *StoreConfig) Init()
func (*StoreConfig) NewMysqlDB ¶
func (conf *StoreConfig) NewMysqlDB() (*gorm.DB, error)
func (*StoreConfig) NewRedisClient ¶
func (conf *StoreConfig) NewRedisClient() (redis.UniversalClient, error)
type TracerConf ¶
Click to show internal directories.
Click to hide internal directories.