Documentation
¶
Index ¶
- Constants
- func GetCurrentConfig(logger *logger.Logger) (*client.RequestRsyslog, error)
- func GetServiceStatus(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)
- func RenderConfig(config *client.RequestRsyslog) (string, error)
- func RestartService(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error
- func ServiceControl(ctx context.Context, serviceName string, action client.SubCommandType, ...) (*client.ServiceStatus, error)
- func UpdateConfig(ctx context.Context, config *client.RequestRsyslog, logger *logger.Logger, ...) error
Constants ¶
const ( // ConfigPath is the live rsyslog drop-in the agent manages. Exported so the // reconcile loop can read it to detect drift/deletion. ConfigPath = "/etc/rsyslog.d/50-elchi.conf" )
Variables ¶
This section is empty.
Functions ¶
func GetCurrentConfig ¶
func GetCurrentConfig(logger *logger.Logger) (*client.RequestRsyslog, error)
GetCurrentConfig reads the current rsyslog configuration
func GetServiceStatus ¶
func GetServiceStatus(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)
GetServiceStatus returns the current rsyslog service status using systemd package
func RenderConfig ¶ added in v1.6.1
func RenderConfig(config *client.RequestRsyslog) (string, error)
RenderConfig validates the request and returns the exact 50-elchi.conf content that UpdateConfig writes. It is the single source of truth for the rendered file, shared by UpdateConfig and the reconcile loop (which compares it against the live file to detect drift), so the two can never diverge.
func RestartService ¶
func RestartService(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error
RestartService restarts the rsyslog service and syslog.socket
func ServiceControl ¶
func ServiceControl(ctx context.Context, serviceName string, action client.SubCommandType, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)
ServiceControl performs service control operations (start/stop/restart/status) For rsyslog, we need to control both rsyslog.service and syslog.socket
func UpdateConfig ¶
func UpdateConfig(ctx context.Context, config *client.RequestRsyslog, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error
UpdateConfig writes new rsyslog configuration
Types ¶
This section is empty.