usersync

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 14 Imported by: ? 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 usersync is the per-user helper's work (`<slug>-ui.exe --user-sync`): it asks the service for the user-placement plan, places each tree into the caller's own profile from the archive the service staged, removes the trees its own receipts track that left the plan, and reports every result back. It runs as the user, never as SYSTEM, and is portable so it is tested on any host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sync

func Sync(ctx context.Context, client Client, guard placement.Guard, receiptDir string, logger *slog.Logger) ([]service.UserPlacementResult, error)

Sync applies the service's user-placement plan for one user. guard holds the OS (harness.Windows), the compiled write roots, whose user-scope roots apply, the refused data and binary directories, and Vars["USERPROFILE"]. Receipts live in receiptDir. Held entries are neither placed nor removed. The trees' templates render with the plan's facts, each entry's managed flag and this account's login name; the helper runs no script of its own. Every result is logged and reported; the returned error is set only when the login name cannot be read or no plan could be fetched, after retrying a service that cannot be reached yet for up to a minute, in which case nothing is placed or removed.

Two syncs for one user at once (a logon and a storefront start) can trip over each other's staging directory; the loser logs a failed result and the next sync converges. A per-user lock is the upgrade if that shows up.

Types

type Client

type Client interface {
	ListUserPlacements(context.Context) (service.UserPlacements, error)
	ReportUserPlacements(context.Context, []service.UserPlacementResult) error
}

Client is the part of the service client the helper uses.

Jump to

Keyboard shortcuts

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