crash

package
v0.0.0-...-d2b205c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpReportsOnDisk

func CleanUpReportsOnDisk(crashDir string)

func FormatDirectoryListing

func FormatDirectoryListing(dirPath string) (string, error)

func GetCrashDir

func GetCrashDir() string

func GetUserCountry

func GetUserCountry() (string, error)

GetUserCountry fetches the user's country from Mullvad's API

func InitReporter

func InitReporter(ctx context.Context)

Reporter returns the global reporter instance

func MaskAPIKey

func MaskAPIKey(key string) string

func WriteReport

func WriteReport(
	mainErr error,
	runtimeInfo string,
	settings config.Settings,
	logBuffer io.Reader,
) (string, error)

Types

type ExecutionScope

type ExecutionScope struct {
	StartTime     time.Time
	MediaInfoDump string
}

ExecutionScope holds information specific to current processing

type GlobalScope

type GlobalScope struct {
	StartTime     time.Time
	FFmpegPath    string
	FFmpegVersion string
	MediaInfoVer  string
}

GlobalScope holds program-wide information

type ReporterInstance

type ReporterInstance struct {
	// contains filtered or unexported fields
}
var (
	Reporter *ReporterInstance
)

func (*ReporterInstance) ClearAllRecords

func (r *ReporterInstance) ClearAllRecords()

func (*ReporterInstance) ClearExecutionRecords

func (r *ReporterInstance) ClearExecutionRecords()

func (*ReporterInstance) GetScopes

func (r *ReporterInstance) GetScopes() (GlobalScope, ExecutionScope)

GetScopes returns both global and execution scopes

func (*ReporterInstance) GetSnapshotsString

func (r *ReporterInstance) GetSnapshotsString() string

GetSnapshotsString returns a formatted string of all relevant snapshots

func (*ReporterInstance) GetUptime

func (r *ReporterInstance) GetUptime() time.Duration

GetUptime returns the duration since reporter was started

func (*ReporterInstance) Record

func (r *ReporterInstance) Record(update func(*GlobalScope, *ExecutionScope))

Record updates either global or execution scope information

func (*ReporterInstance) SaveExecSnapshot

func (r *ReporterInstance) SaveExecSnapshot(step string, state string)

func (*ReporterInstance) SaveSnapshot

func (r *ReporterInstance) SaveSnapshot(step string, state string)

Snapshots are assumed to belong to global scope by default

type RuntimeInfo

type RuntimeInfo struct {
	StartTime time.Time
	// contains filtered or unexported fields
}

RuntimeInfo holds the runtime information and collection utilities.

func NewRuntimeInfo

func NewRuntimeInfo() *RuntimeInfo

NewRuntimeInfo creates a new RuntimeInfo instance with the current time.

func (*RuntimeInfo) String

func (ri *RuntimeInfo) String() string

String generates the complete runtime information report.

type SnapshotType

type SnapshotType int
const (
	GlobalSnapshot SnapshotType = iota
	ExecutionSnapshot
)

Jump to

Keyboard shortcuts

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