sessionaccess

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 5 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 sessionaccess bridges root runtime details to packages inside the module. It is unavailable to external modules by Go's internal-package rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(session any)

Close calls the runtime-owned app cleanup hook for an offscreen session.

func MediaOption

func MediaOption(commands, publish any) any

func Register

func Register(session any, access Access)

func RegisterHelpers

func RegisterHelpers(value Helpers)

func RunTerminal

func RunTerminal(ctx context.Context, session any, media Media) error

RunTerminal invokes the terminal loop attached by root Run to a selected composite host.

func SetPreciseScrolling added in v0.4.0

func SetPreciseScrolling(session any, on bool)

SetPreciseScrolling sets a session's WithPreciseScrolling policy, for host tests that build sessions with NewSession.

func SetQuitRequests added in v0.4.0

func SetQuitRequests(session any, on bool)

SetQuitRequests sets a session's WithQuitRequests policy, for host tests that build sessions with NewSession.

func SettleFrame

func SettleFrame(view, handle any, last map[string]layout.Rect, width, height int) (any, layout.Composition, map[string]layout.Rect)

func Unregister

func Unregister(session any)

Types

type Access

type Access struct {
	SetAsync       func(dispatch func(func()), clock Clock)
	ConfigureTests func(HarnessEffects)
	Close          func()
	RunTerminal    func(context.Context, Media) error
	// SetQuitRequests turns WithQuitRequests on or off for host tests.
	SetQuitRequests func(bool)
	// SetPreciseScrolling turns WithPreciseScrolling on or off for host
	// tests.
	SetPreciseScrolling func(bool)
}

func For

func For(session any) (Access, bool)

type Clock

type Clock interface {
	Tick(context.Context, time.Duration, func(time.Time))
}

type HarnessEffects

type HarnessEffects struct {
	Context       context.Context
	Updates       any
	SendUpdate    func(context.Context, any) bool
	Quit          func()
	Dispatch      func(func())
	Clock         Clock
	Capabilities  any
	SetClipboard  func(string)
	ReadClipboard func()
	ShowDialog    func(any, func(any))
	Notify        func(any)
	Desktop       func(any)
}

HarnessEffects contains test-only Effects overrides. Updates and service values are deliberately untyped here; the root package restores their concrete generic types when applying the configuration.

type Helpers

type Helpers struct {
	SettleFrame func(view, handle any, last map[string]layout.Rect, width, height int) (any, layout.Composition, map[string]layout.Rect)
	MediaOption func(commands, publish any) any
}

type Media

type Media struct {
	Commands any
	Publish  any
}

Jump to

Keyboard shortcuts

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