All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m18s
Test / Hakurei (push) Successful in 3m17s
Test / Sandbox (race detector) (push) Successful in 4m7s
Test / Hpkg (push) Successful in 4m13s
Test / Hakurei (race detector) (push) Successful in 5m3s
Test / Flake checks (push) Successful in 1m40s
These packages are highly specific to hakurei and are difficult to use safely from other pieces of code. Their exported symbols are made available until v0.4.0 where they will be removed for #24. Signed-off-by: Ophestra <cat@gensokyo.uk>
51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
// Package system exposes the internal/system package.
|
|
//
|
|
// Deprecated: This package will be removed in 0.4.
|
|
package system
|
|
|
|
import (
|
|
"context"
|
|
_ "unsafe" // for go:linkname
|
|
|
|
"hakurei.app/hst"
|
|
"hakurei.app/internal/system"
|
|
"hakurei.app/message"
|
|
)
|
|
|
|
// ErrDBusConfig is returned when a required hst.BusConfig argument is nil.
|
|
//
|
|
//go:linkname ErrDBusConfig hakurei.app/internal/system.ErrDBusConfig
|
|
var ErrDBusConfig error
|
|
|
|
// OpError is returned by [I.Commit] and [I.Revert].
|
|
type OpError = system.OpError
|
|
|
|
const (
|
|
// User type is reverted at final instance exit.
|
|
User = system.User
|
|
// Process type is unconditionally reverted on exit.
|
|
Process = system.Process
|
|
|
|
CM = system.CM
|
|
)
|
|
|
|
// Criteria specifies types of Op to revert.
|
|
type Criteria = system.Criteria
|
|
|
|
// Op is a reversible system operation.
|
|
type Op = system.Op
|
|
|
|
// TypeString extends [Enablement.String] to support [User] and [Process].
|
|
//
|
|
//go:linkname TypeString hakurei.app/internal/system.TypeString
|
|
func TypeString(e hst.Enablement) string
|
|
|
|
// New returns the address of a new [I] targeting uid.
|
|
//
|
|
//go:linkname New hakurei.app/internal/system.New
|
|
func New(ctx context.Context, msg message.Msg, uid int) (sys *I)
|
|
|
|
// An I provides deferred operating system interaction. [I] must not be copied.
|
|
// Methods of [I] must not be used concurrently.
|
|
type I = system.I
|