Documentation
¶
Index ¶
- func ExportBundle(path string) (string, error)
- func RemoveStaleBundles(dir string, maxAge time.Duration)
- func UploadDebugBundle(ctx context.Context, url, managementURL, filePath string, insecure bool) (key string, err error)
- type BundleConfig
- type BundleGenerator
- type GeneratorDependencies
- type LogOpener
- type MetricsExporter
- type WGIface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportBundle ¶
ExportBundle renames a generated bundle out of the RemoveStaleBundles pattern and returns the new path. The caller owns the file from then on; an export abandoned for longer than exportedBundleMaxAge is removed by RemoveStaleBundles.
func RemoveStaleBundles ¶
RemoveStaleBundles deletes bundle zips that an interrupted generation or upload left behind in dir. Only files older than maxAge go, so a bundle that another caller is still writing or uploading in the same directory survives. Exported bundles are kept for exportedBundleMaxAge instead.
Types ¶
type BundleConfig ¶
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
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
MetricsExporter is an interface for exporting metrics
type WGIface ¶ added in v0.46.0
type WGIface interface {
FullStats() (*configurer.Stats, error)
}