Documentation ¶
Overview ¶
Package module is the scaffolding for a system-probe module and the loader used upon start
Index ¶
- Variables
- func Close()
- func GetStats() map[string]interface{}
- func Register(cfg *sysconfigtypes.Config, httpMux *mux.Router, factories []Factory, ...) error
- func RestartModule(factory Factory, wmeta workloadmeta.Component, tagger tagger.Component, ...) error
- type Factory
- type FactoryDependencies
- type Module
- type Router
Constants ¶
This section is empty.
Variables ¶
var ErrNotEnabled = errors.New("module is not enabled")
ErrNotEnabled is a special error type that should be returned by a Factory when the associated Module is not enabled.
Functions ¶
func GetStats ¶
func GetStats() map[string]interface{}
GetStats returns the stats from all modules, namespaced by their names
func Register ¶
func Register(cfg *sysconfigtypes.Config, httpMux *mux.Router, factories []Factory, wmeta workloadmeta.Component, tagger tagger.Component, telemetry telemetry.Component) error
Register a set of modules, which involves: * Initialization using the provided Factory; * Registering the HTTP endpoints of each module; * Register the gRPC server;
func RestartModule ¶
func RestartModule(factory Factory, wmeta workloadmeta.Component, tagger tagger.Component, telemetry telemetry.Component) error
RestartModule triggers a module restart
Types ¶
type Factory ¶
type Factory struct { Name sysconfigtypes.ModuleName ConfigNamespaces []string Fn func(cfg *sysconfigtypes.Config, deps FactoryDependencies) (Module, error) NeedsEBPF func() bool }
Factory encapsulates the initialization of a Module
type FactoryDependencies ¶
type FactoryDependencies struct { fx.In WMeta workloadmeta.Component Tagger tagger.Component Telemetry telemetry.Component }
FactoryDependencies defines the fx dependencies for a module factory
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router provides a wrapper around mux.Router so routes can be re-registered This is needed to support the module-restart feature
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(path string, responseWriter func(http.ResponseWriter, *http.Request)) *mux.Route
HandleFunc registers a HandleFunc in such a way that routes can be registered multiple times