taskquery

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package taskquery reads one fixed current-user Task Scheduler registration. It never establishes ownership, changes a task, or identifies a daemon PID.

Index

Constants

View Source
const (
	Present = "present"
	// Absent is reserved until native GetTask missing-HRESULT contracts exist.
	// This version deliberately returns Unknown for every failed GetTask.
	Absent  = "absent"
	Unknown = "unknown"
)

Variables

View Source
var (
	ErrUnsupported       = errors.New("taskquery requires Windows")
	ErrIdentity          = errors.New("taskquery current identity is unverified or changed")
	ErrTrust             = errors.New("taskquery system PowerShell trust could not be established")
	ErrTransport         = errors.New("taskquery bridge execution failed; task state is unknown")
	ErrProtocol          = errors.New("taskquery bridge response is invalid; task state is unknown")
	ErrNative            = errors.New("taskquery native query failed; task state is unknown")
	ErrAbsenceUnverified = errors.New("taskquery missing HRESULT has no native contract yet; absence is unverified")
)

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Kind    string `json:"kind"`
	Stage   string `json:"stage"`
	HRESULT string `json:"hresult,omitempty"`
}

type Properties

type Properties struct {
	Enabled            bool   `json:"enabled"`
	SchedulerState     uint32 `json:"scheduler_state"`
	SchedulerStateName string `json:"scheduler_state_name"`
	LastTaskResult     int32  `json:"last_task_result"`
}

type Reader

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

func New

func New() (*Reader, error)

New verifies the current ordinary Windows identity and system bridge path. Construction does not contact Task Scheduler. Other platforms are unsupported.

func (*Reader) Query

func (r *Reader) Query(ctx context.Context) (Status, error)

Query reads only this process's verified fixed current-user task registration. A returned registration is never classified as managed. No action is retried.

type Status

type Status struct {
	SchemaVersion int         `json:"schema_version"`
	CheckedAt     time.Time   `json:"checked_at"`
	TaskPath      string      `json:"task_path"`
	Presence      string      `json:"presence"`
	Ownership     string      `json:"ownership"`
	Task          *Properties `json:"task,omitempty"`
	Failure       *Failure    `json:"failure,omitempty"`
}

Jump to

Keyboard shortcuts

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