debug

package
v0.77.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: BSD-3-Clause Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UploadDebugBundle added in v0.64.0

func UploadDebugBundle(ctx context.Context, url, managementURL, filePath string, insecure bool) (key string, err error)

Types

type BundleConfig

type BundleConfig struct {
	Anonymize bool
	// AnonymizeLevel selects how much the anonymizer redacts.
	// anonymize.LevelStrict implies Anonymize.
	AnonymizeLevel    anonymize.Level
	IncludeSystemInfo bool
	LogFileCount      uint32
}

type BundleGenerator

type BundleGenerator struct {
	// contains filtered or unexported fields
}

func NewBundleGenerator

func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGenerator

func (*BundleGenerator) Generate

func (g *BundleGenerator) Generate() (resp string, err error)

Generate creates a debug bundle and returns the location.

type GeneratorDependencies

type GeneratorDependencies struct {
	InternalConfig *profilemanager.Config
	StatusRecorder *peer.Status
	SyncResponse   *mgmProto.SyncResponse
	LogPath        string
	UILogPath      string // Absolute path to the desktop UI's gui-client.log, reported via RegisterUILog. Empty if no UI registered one.
	// UILogOpener opens the UI log and its rotated siblings. The path comes from
	// a local IPC caller, so the daemon must not open it with plain os.Open: the
	// opener is where the caller's right to that file is enforced. Defaults to
	// os.Open, which is only correct where the path is not caller-supplied
	// (mobile).
	UILogOpener   LogOpener
	TempDir       string // Directory for temporary bundle zip files. If empty, os.TempDir() is used.
	StatePath     string // Path to the state file. If empty, the ServiceManager default path is used.
	CPUProfile    []byte
	CapturePath   string
	RefreshStatus func()
	ClientMetrics MetricsExporter
	DaemonVersion string
	CliVersion    string
}

type LogOpener added in v0.76.1

type LogOpener func(path string) (*os.File, error)

LogOpener opens a log file for inclusion in the bundle. It exists so that log files whose path was supplied by an IPC caller can be opened under a check the daemon defines, instead of being opened with the daemon's privileges unconditionally.

type MetricsExporter added in v0.67.0

type MetricsExporter interface {
	Export(w io.Writer) error
}

MetricsExporter is an interface for exporting metrics

type WGIface added in v0.46.0

type WGIface interface {
	FullStats() (*configurer.Stats, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL