Documentation ¶
Index ¶
- Variables
- func RegisterEngine(name string, constructor EngineNewerFunc)
- func RegisterExecutor(name string, constructor ExecutorNewerFunc)
- func RegisterMonitor(name string, constructor MonitorNewerFunc)
- func RegisterPolicy(name string, constructor PolicyNewerFunc)
- func RegisterWatcher(name string, constructor WatcherNewerFunc)
- type App
- type EngineNewerFunc
- type ExampleEngine
- func (e *ExampleEngine) AddMonitorReceiver(policy_id string, receiver MonitorReceiver)
- func (e *ExampleEngine) GetApp(id string) (App, error)
- func (e *ExampleEngine) GetConfig() string
- func (e *ExampleEngine) RegisterApp(id string, policy_id string, podMeta string) error
- func (e *ExampleEngine) SetConfig(configJSON string) error
- func (e *ExampleEngine) Start()
- func (e *ExampleEngine) UnRegisterApp(id string) error
- type ExampleMonitor
- type ExampleMonitorReceiver
- type ExamplePodWatcher
- type ExamplePolicy
- func (p *ExamplePolicy) AddMonitorReceivers(receiver MonitorReceiver) error
- func (p *ExamplePolicy) GetConfig() string
- func (p *ExamplePolicy) GetExecutors() map[string]Executor
- func (p *ExamplePolicy) GetMonitorReceivers() []MonitorReceiver
- func (p *ExamplePolicy) GetMonitors() map[string]Monitor
- func (p *ExamplePolicy) GetName() string
- func (p *ExamplePolicy) GetWatchers() map[string]Watcher
- func (p *ExamplePolicy) OnMonitorData(e utils.Event)
- func (p *ExamplePolicy) OnRegister(e utils.Event)
- func (p *ExamplePolicy) SetConfig(s string) error
- func (p *ExamplePolicy) Start()
- type Executor
- type ExecutorConfig
- type ExecutorNewerFunc
- type FixedClassMonitorConfig
- type FixedClassPolicyConfig
- type Monitor
- type MonitorConfig
- type MonitorNewerFunc
- type MonitorReceiver
- type PodWatcherConfig
- type Policy
- type PolicyConfig
- type PolicyNewerFunc
- type RDTEngineConfig
- type RDTExecutor
- type RDTExecutorConfig
- type Resctrl
- type ResourceEngine
- type ResourceEngineConfig
- type SampleEventData
- type Watcher
- type WatcherConfig
- type WatcherNewerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var Cache = make(map[string]App)
View Source
var EnginerNewerFuncs = make(map[string]EngineNewerFunc)
View Source
var ExecutorChan = make(chan utils.Event)
View Source
var ExecutorNewerFuncs = make(map[string]ExecutorNewerFunc)
View Source
var MonitorChan = make(chan utils.Event)
View Source
var MonitorDataChan = make(chan utils.Event)
View Source
var MonitorNewerFuncs = make(map[string]MonitorNewerFunc)
View Source
var PolicyNewerFuncs = make(map[string]PolicyNewerFunc)
View Source
var RegisterChan = make(chan utils.Event)
View Source
var WatcherChan = make(chan utils.Event)
View Source
var WatcherNewerFuncs = make(map[string]WatcherNewerFunc)
Functions ¶
func RegisterEngine ¶
func RegisterEngine(name string, constructor EngineNewerFunc)
func RegisterExecutor ¶
func RegisterExecutor(name string, constructor ExecutorNewerFunc)
func RegisterMonitor ¶
func RegisterMonitor(name string, constructor MonitorNewerFunc)
func RegisterPolicy ¶
func RegisterPolicy(name string, constructor PolicyNewerFunc)
func RegisterWatcher ¶
func RegisterWatcher(name string, constructor WatcherNewerFunc)
Types ¶
type EngineNewerFunc ¶
type EngineNewerFunc func() (ResourceEngine, error)
type ExampleEngine ¶ added in v0.3.0
type ExampleEngine struct {
// contains filtered or unexported fields
}
func (*ExampleEngine) AddMonitorReceiver ¶ added in v0.3.0
func (e *ExampleEngine) AddMonitorReceiver(policy_id string, receiver MonitorReceiver)
func (*ExampleEngine) GetApp ¶ added in v0.3.0
func (e *ExampleEngine) GetApp(id string) (App, error)
func (*ExampleEngine) GetConfig ¶ added in v0.3.0
func (e *ExampleEngine) GetConfig() string
func (*ExampleEngine) RegisterApp ¶ added in v0.3.0
func (e *ExampleEngine) RegisterApp(id string, policy_id string, podMeta string) error
func (*ExampleEngine) SetConfig ¶ added in v0.3.0
func (e *ExampleEngine) SetConfig(configJSON string) error
func (*ExampleEngine) Start ¶ added in v0.3.0
func (e *ExampleEngine) Start()
func (*ExampleEngine) UnRegisterApp ¶ added in v0.3.0
func (e *ExampleEngine) UnRegisterApp(id string) error
type ExampleMonitor ¶ added in v0.3.0
type ExampleMonitor struct {
// contains filtered or unexported fields
}
func (*ExampleMonitor) GetConfig ¶ added in v0.3.0
func (m *ExampleMonitor) GetConfig() string
func (*ExampleMonitor) GetName ¶ added in v0.3.0
func (m *ExampleMonitor) GetName() string
func (*ExampleMonitor) OnMonitor ¶ added in v0.3.0
func (m *ExampleMonitor) OnMonitor(e utils.Event)
func (*ExampleMonitor) SetConfig ¶ added in v0.3.0
func (m *ExampleMonitor) SetConfig(s string) error
func (*ExampleMonitor) Start ¶ added in v0.3.0
func (m *ExampleMonitor) Start()
type ExampleMonitorReceiver ¶ added in v0.3.0
type ExampleMonitorReceiver struct {
// contains filtered or unexported fields
}
func (*ExampleMonitorReceiver) GetMonitorName ¶ added in v0.3.0
func (receiver *ExampleMonitorReceiver) GetMonitorName() string
func (*ExampleMonitorReceiver) GetPolicyName ¶ added in v0.3.0
func (receiver *ExampleMonitorReceiver) GetPolicyName() string
func (*ExampleMonitorReceiver) OnMonitorData ¶ added in v0.3.0
func (receiver *ExampleMonitorReceiver) OnMonitorData(event utils.Event)
type ExamplePodWatcher ¶ added in v0.3.0
type ExamplePodWatcher struct {
// contains filtered or unexported fields
}
func (*ExamplePodWatcher) GetConfig ¶ added in v0.3.0
func (w *ExamplePodWatcher) GetConfig() string
func (*ExamplePodWatcher) GetName ¶ added in v0.3.0
func (w *ExamplePodWatcher) GetName() string
func (*ExamplePodWatcher) OnWatch ¶ added in v0.3.0
func (w *ExamplePodWatcher) OnWatch(e utils.Event)
func (*ExamplePodWatcher) SetConfig ¶ added in v0.3.0
func (w *ExamplePodWatcher) SetConfig(s string) error
func (*ExamplePodWatcher) Start ¶ added in v0.3.0
func (w *ExamplePodWatcher) Start()
type ExamplePolicy ¶ added in v0.3.0
type ExamplePolicy struct {
// contains filtered or unexported fields
}
func (*ExamplePolicy) AddMonitorReceivers ¶ added in v0.3.0
func (p *ExamplePolicy) AddMonitorReceivers(receiver MonitorReceiver) error
func (*ExamplePolicy) GetConfig ¶ added in v0.3.0
func (p *ExamplePolicy) GetConfig() string
func (*ExamplePolicy) GetExecutors ¶ added in v0.3.0
func (p *ExamplePolicy) GetExecutors() map[string]Executor
func (*ExamplePolicy) GetMonitorReceivers ¶ added in v0.3.0
func (p *ExamplePolicy) GetMonitorReceivers() []MonitorReceiver
func (*ExamplePolicy) GetMonitors ¶ added in v0.3.0
func (p *ExamplePolicy) GetMonitors() map[string]Monitor
func (*ExamplePolicy) GetName ¶ added in v0.3.0
func (p *ExamplePolicy) GetName() string
func (*ExamplePolicy) GetWatchers ¶ added in v0.3.0
func (p *ExamplePolicy) GetWatchers() map[string]Watcher
func (*ExamplePolicy) OnMonitorData ¶ added in v0.3.1
func (p *ExamplePolicy) OnMonitorData(e utils.Event)
func (*ExamplePolicy) OnRegister ¶ added in v0.3.0
func (p *ExamplePolicy) OnRegister(e utils.Event)
func (*ExamplePolicy) SetConfig ¶ added in v0.3.0
func (p *ExamplePolicy) SetConfig(s string) error
func (*ExamplePolicy) Start ¶ added in v0.3.0
func (p *ExamplePolicy) Start()
type Executor ¶
type Executor interface { GetName() string SetConfig(string) error // Set new configuration. GetConfig() string // Get current configuration. OnExecutor(event utils.Event) Start() }
func NewExecutor ¶
NewPolicy creates a new instance of a policy based on its name.
func RDTExecutorNewer ¶
type ExecutorConfig ¶
type ExecutorNewerFunc ¶
type FixedClassMonitorConfig ¶
type FixedClassMonitorConfig struct { }
type FixedClassPolicyConfig ¶
type FixedClassPolicyConfig struct { ConfigPath string `yaml:"configPath"` Watchers []WatcherConfig `yaml:"watchers"` Monitors []MonitorConfig `yaml:"monitors"` Executors []ExecutorConfig `yaml:"executors"` }
type Monitor ¶
type Monitor interface { GetName() string SetConfig(config string) error GetConfig() string OnMonitor(e utils.Event) Start() }
func FixedClassMonitorNewer ¶
func NewMonitor ¶
NewPolicy creates a new instance of a policy based on its name.
type MonitorConfig ¶
type MonitorNewerFunc ¶
type MonitorReceiver ¶
type MonitorReceiver interface { OnMonitorData(event utils.Event) GetPolicyName() string GetMonitorName() string }
func NewRDTMonitorReceiver ¶
func NewRDTMonitorReceiver(policy_id, monitor_id string) MonitorReceiver
type PodWatcherConfig ¶
type PodWatcherConfig struct {
Pods []string `json:"pods"`
}
type Policy ¶
type Policy interface { GetName() string OnRegister(e utils.Event) OnMonitorData(e utils.Event) SetConfig(string) error // Set new configuration. GetConfig() string // Get current configuration. GetMonitors() map[string]Monitor GetWatchers() map[string]Watcher GetExecutors() map[string]Executor GetMonitorReceivers() []MonitorReceiver AddMonitorReceivers(receiver MonitorReceiver) error Start() }
func FixedClassPolicyNewer ¶
type PolicyConfig ¶
type PolicyNewerFunc ¶
type RDTEngineConfig ¶
type RDTEngineConfig struct { Name string Config string Policy []PolicyConfig }
type RDTExecutor ¶
type RDTExecutor struct {
// contains filtered or unexported fields
}
func (*RDTExecutor) GetConfig ¶
func (e *RDTExecutor) GetConfig() string
func (*RDTExecutor) GetName ¶
func (e *RDTExecutor) GetName() string
func (*RDTExecutor) OnExecutor ¶
func (e *RDTExecutor) OnExecutor(event utils.Event)
func (*RDTExecutor) SetConfig ¶
func (e *RDTExecutor) SetConfig(s string) error
func (*RDTExecutor) Start ¶
func (e *RDTExecutor) Start()
type RDTExecutorConfig ¶
type RDTExecutorConfig struct { }
type ResourceEngine ¶
type ResourceEngine interface { RegisterApp(id string, policy_id string, podMeta string) error UnRegisterApp(id string) error GetApp(id string) (App, error) SetConfig(config string) error GetConfig() string Start() AddMonitorReceiver(policy_id string, receiver MonitorReceiver) }
func NewEngine ¶
func NewEngine(name string) (ResourceEngine, error)
func RDTEngineNewer ¶
func RDTEngineNewer() (ResourceEngine, error)
type ResourceEngineConfig ¶
type SampleEventData ¶
type SampleEventData struct {
// contains filtered or unexported fields
}
func (*SampleEventData) GetEventType ¶
func (s *SampleEventData) GetEventType() utils.EventType
type Watcher ¶
type Watcher interface { GetName() string SetConfig(config string) error GetConfig() string OnWatch(e utils.Event) Start() }
func NewWatcher ¶
NewPolicy creates a new instance of a policy based on its name.
func PodWatcherNewer ¶
type WatcherConfig ¶
type WatcherNewerFunc ¶
Click to show internal directories.
Click to hide internal directories.