Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewManagerClient ¶
func NewManagerClient(client manager.ManagerClient) dc.ManagerClient
Types ¶
type Config ¶
type Config struct {
base.Options `yaml:",inline" mapstructure:",squash"`
Scheduler SchedulerConfig `yaml:"scheduler" mapstructure:"scheduler"`
Server ServerConfig `yaml:"server" mapstructure:"server"`
Worker SchedulerWorkerConfig `yaml:"worker" mapstructure:"worker"`
GC GCConfig `yaml:"gc" mapstructure:"gc"`
Dynconfig *DynconfigOptions `yaml:"dynconfig" mapstructure:"dynconfig"`
Manager ManagerConfig `yaml:"manager" mapstructure:"manager"`
}
type DynconfigInterface ¶
type DynconfigInterface interface {
// Get the dynamic config from manager.
Get() (*manager.Scheduler, error)
// Register allows an instance to register itself to listen/observe events.
Register(Observer)
// Deregister allows an instance to remove itself from the collection of observers/listeners.
Deregister(Observer)
// Notify publishes new events to listeners.
Notify() error
// Serve the dynconfig listening service.
Serve() error
// Stop the dynconfig listening service.
Stop()
}
func NewDynconfig ¶
func NewDynconfig(sourceType dc.SourceType, cdnDirPath string, options ...dc.Option) (DynconfigInterface, error)
TODO(Gaius) Rely on manager to delete cdnDirPath
type DynconfigOptions ¶
type DynconfigOptions struct {
// Type is dynconfig source type.
Type dc.SourceType `yaml:"type" mapstructure:"type"`
// ExpireTime is expire time for manager cache.
ExpireTime time.Duration `yaml:"expireTime" mapstructure:"expireTime"`
// Addr is dynconfig source address.
Addr string `yaml:"addr" mapstructure:"addr"`
// Path is dynconfig filepath.
Path string `yaml:"path" mapstructure:"path"`
// CachePath is cache filepath.
CachePath string `yaml:"cachePath" mapstructure:"cachePath"`
// CDNDirPath is cdn dir.
CDNDirPath string `yaml:"cdnDirPath" mapstructure:"cdnDirPath"`
}
type GCConfig ¶
type KeepAliveConfig ¶
type KeepAliveConfig struct {
// Keep alive interval
Interval time.Duration `yaml:"interval" mapstructure:"interval"`
// Keep alive retry max attempts
RetryMaxAttempts int `yaml:"retryMaxAttempts" mapstructure:"retryMaxAttempts"`
// Keep alive retry init backoff
RetryInitBackOff float64 `yaml:"retryInitBackOff" mapstructure:"retryInitBackOff"`
// Keep alive retry max backoff
RetryMaxBackOff float64 `yaml:"retryMaxBackOff" mapstructure:"retryMaxBackOff"`
}
type ManagerConfig ¶
type ManagerConfig struct {
// Addr is manager address.
Addr string `yaml:"addr" mapstructure:"addr"`
// SchedulerClusterID is scheduler cluster id.
SchedulerClusterID uint64 `yaml:"schedulerClusterID" mapstructure:"schedulerClusterID"`
// KeepAlive configuration
KeepAlive KeepAliveConfig `yaml:"keepAlive" mapstructure:"keepAlive"`
}
type Observer ¶
type SchedulerConfig ¶
type SchedulerWorkerConfig ¶
type SchedulerWorkerConfig struct {
WorkerNum int `yaml:"workerNum" mapstructure:"workerNum"`
WorkerJobPoolSize int `yaml:"workerJobPoolSize" mapstructure:"workerJobPoolSize"`
SenderNum int `yaml:"senderNum" mapstructure:"senderNum"`
SenderJobPoolSize int `yaml:"senderJobPoolSize" mapstructure:"senderJobPoolSize"`
}
Source Files
¶
- config.go
- config_linux.go
- dynconfig.go
Click to show internal directories.
Click to hide internal directories.