Documentation ¶
Index ¶
- Constants
- type ControlRequest
- type ControlResponse
- type Controller
- type ControllerAPI
- type ControllerConfig
- type ControllerFactory
- type DefaultModule
- func (m *DefaultModule) ClearSignal() <-chan struct{}
- func (m *DefaultModule) Name() string
- func (m *DefaultModule) RegisterSubModule(subModule string, start func() error, stop func() error) error
- func (m *DefaultModule) Start(opts ...Option) error
- func (m *DefaultModule) Status() ModuleStatus
- func (m *DefaultModule) Stop(msg string) error
- type ExportSubModule
- type FileWatchOption
- type HttpAPI
- type HttpControllerConfig
- type Module
- type ModuleStatus
- type Option
- type Profile
- type ProfileOption
- type StartModule
- type StopModule
Constants ¶
View Source
const ( NoError = 1 StartWithError = 2 StopWithError = 3 NoOperation = 4 )
View Source
const ControllerComponent string = "controller"
View Source
const PathPrefix = "/"
View Source
const ProfileModule = "profile"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlRequest ¶
type ControlRequest struct { // start / stop Operation string Pid int Tid int // json Options Options *json.RawMessage }
type ControlResponse ¶
type Controller ¶
type Controller interface { GetModuleKey() string RegistSubModules(subModules ...ExportSubModule) HandRequest(*ControlRequest) *ControlResponse GetOptions(*json.RawMessage) []Option }
type ControllerAPI ¶
type ControllerAPI interface { RegistController(c Controller) RegistModule(module string, subModules ...ExportSubModule) }
type ControllerConfig ¶
type ControllerConfig struct { Http *HttpControllerConfig Modules []string }
type ControllerFactory ¶
type ControllerFactory struct {
Controller ControllerAPI
}
func (*ControllerFactory) ConstructConfig ¶
func (cf *ControllerFactory) ConstructConfig(viper *viper.Viper, tools *component.TelemetryTools) error
func (*ControllerFactory) RegistModule ¶
func (cf *ControllerFactory) RegistModule(module string, subModules ...ExportSubModule)
type DefaultModule ¶
type DefaultModule struct {
// contains filtered or unexported fields
}
func NewModule ¶
func NewModule(name string, tools *component.TelemetryTools, status ModuleStatus) *DefaultModule
func (*DefaultModule) ClearSignal ¶
func (m *DefaultModule) ClearSignal() <-chan struct{}
func (*DefaultModule) Name ¶
func (m *DefaultModule) Name() string
func (*DefaultModule) RegisterSubModule ¶
func (m *DefaultModule) RegisterSubModule(subModule string, start func() error, stop func() error) error
func (*DefaultModule) Start ¶
func (m *DefaultModule) Start(opts ...Option) error
func (*DefaultModule) Status ¶
func (m *DefaultModule) Status() ModuleStatus
func (*DefaultModule) Stop ¶
func (m *DefaultModule) Stop(msg string) error
type ExportSubModule ¶
type FileWatchOption ¶
type HttpAPI ¶
func NewHttpAPI ¶
func NewHttpAPI(tools *component.TelemetryTools) *HttpAPI
func (*HttpAPI) RegistController ¶
func (hc *HttpAPI) RegistController(c Controller)
func (*HttpAPI) RegistModule ¶
func (hc *HttpAPI) RegistModule(module string, subModules ...ExportSubModule)
type HttpControllerConfig ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithStopInterval ¶
func WithStopSignal ¶
func WithStopSignal(stopch <-chan struct{}) Option
type Profile ¶
type Profile struct {
Module
}
func NewProfileController ¶
func NewProfileController(tools *component.TelemetryTools) *Profile
func (*Profile) GetModuleKey ¶
func (*Profile) GetOptions ¶
func (p *Profile) GetOptions(raw_opts *json.RawMessage) []Option
func (*Profile) HandRequest ¶
func (p *Profile) HandRequest(req *ControlRequest) *ControlResponse
func (*Profile) RegistSubModules ¶
func (p *Profile) RegistSubModules(subModules ...ExportSubModule)
type ProfileOption ¶
type ProfileOption struct { // seconds Duration time.Duration // bytes FileWatch *FileWatchOption }
func (*ProfileOption) UnmarshalJSON ¶
func (o *ProfileOption) UnmarshalJSON(b []byte) error
type StartModule ¶
type StartModule func() error
type StopModule ¶
type StopModule func() error
Click to show internal directories.
Click to hide internal directories.