Documentation
¶
Overview ¶
Package support provides diagnostic bundle generation for support requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeLogContent ¶
SanitizeLogContent sanitizes sensitive information from log content.
Types ¶
type AgentInfo ¶
type AgentInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
AgentID string `json:"agent_id,omitempty"`
Hostname string `json:"hostname,omitempty"`
ServerURL string `json:"server_url,omitempty"`
}
AgentInfo contains information about the agent.
type BundleData ¶
type BundleData struct {
AgentInfo *AgentInfo
ServerInfo *ServerInfo
Config *ConfigInfo
RecentErrors []ErrorInfo
CustomData map[string]any
}
BundleData contains all data to include in the bundle.
type BundleInfo ¶
type BundleInfo struct {
Filename string `json:"filename"`
Size int64 `json:"size"`
GeneratedAt time.Time `json:"generated_at"`
}
BundleInfo contains metadata about the generated bundle.
type BundleOptions ¶
type BundleOptions struct {
// IncludeLogs includes sanitized log files.
IncludeLogs bool
// IncludeConfig includes sanitized configuration.
IncludeConfig bool
// IncludeSystemInfo includes system information.
IncludeSystemInfo bool
// IncludeAgentInfo includes agent information.
IncludeAgentInfo bool
// IncludeServerInfo includes server information (server only).
IncludeServerInfo bool
// LogDir is the directory containing log files.
LogDir string
// MaxLogLines is the maximum number of log lines to include per file.
MaxLogLines int
// MaxLogFiles is the maximum number of log files to include.
MaxLogFiles int
}
BundleOptions configures bundle generation.
func DefaultBundleOptions ¶
func DefaultBundleOptions() BundleOptions
DefaultBundleOptions returns default options for bundle generation.
type ConfigInfo ¶
type ConfigInfo struct {
ServerURL string `json:"server_url,omitempty"`
AgentID string `json:"agent_id,omitempty"`
Hostname string `json:"hostname,omitempty"`
AutoCheckUpdate bool `json:"auto_check_update"`
}
ConfigInfo contains sanitized configuration.
type ErrorInfo ¶
type ErrorInfo struct {
Timestamp time.Time `json:"timestamp"`
Level string `json:"level"`
Message string `json:"message"`
Component string `json:"component,omitempty"`
}
ErrorInfo contains information about recent errors.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates support bundles.
func NewGenerator ¶
func NewGenerator(logger zerolog.Logger, options BundleOptions) *Generator
NewGenerator creates a new bundle generator.
func (*Generator) Generate ¶
func (g *Generator) Generate(ctx context.Context, info BundleData) ([]byte, *BundleInfo, error)
Generate creates a support bundle and returns the zip data.
type ServerInfo ¶
type ServerInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
DatabaseURL string `json:"database_url,omitempty"`
}
ServerInfo contains information about the server.
type SystemInfo ¶
type SystemInfo struct {
OS string `json:"os"`
Arch string `json:"arch"`
GoVersion string `json:"go_version"`
NumCPU int `json:"num_cpu"`
Hostname string `json:"hostname"`
OSVersion string `json:"os_version,omitempty"`
KernelInfo string `json:"kernel_info,omitempty"`
UptimeInfo string `json:"uptime_info,omitempty"`
MemoryInfo string `json:"memory_info,omitempty"`
}
SystemInfo contains information about the system.