app

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package app defines the generic App interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength = errors.New("string representation must have a length of 32")
)

Functions

func NewAppID added in v0.4.0

func NewAppID(id *ID) error

func ParseAppID added in v0.4.0

func ParseAppID(id *ID, s string) error

Types

type App

type App interface {
	// ID returns a copy of [ID] held by App.
	ID() ID

	// Seal determines the outcome of config as a [SealedApp].
	// The value of config might be overwritten and must not be used again.
	Seal(config *fst.Config) (SealedApp, error)

	String() string
}

type ID added in v0.4.0

type ID [16]byte

func (*ID) String added in v0.4.0

func (a *ID) String() string

type Paths added in v0.4.0

type Paths struct {
	// path to shared directory (usually `/tmp/fortify.%d`)
	SharePath string `json:"share_path"`
	// XDG_RUNTIME_DIR value (usually `/run/user/%d`)
	RuntimePath string `json:"runtime_path"`
	// application runtime directory (usually `/run/user/%d/fortify`)
	RunDirPath string `json:"run_dir_path"`
}

Paths contains environment-dependent paths used by fortify.

type RunState added in v0.2.10

type RunState struct {
	// Time is the exact point in time where the process was created.
	// Location must be set to UTC.
	//
	// Time is nil if no process was ever created.
	Time *time.Time
	// RevertErr is stored by the deferred revert call.
	RevertErr error
	// WaitErr is the generic error value created by the standard library.
	WaitErr error

	syscall.WaitStatus
}

RunState stores the outcome of a call to [SealedApp.Run].

func (*RunState) SetStart added in v0.4.0

func (rs *RunState) SetStart()

SetStart stores the current time in RunState once.

type SealedApp added in v0.4.0

type SealedApp interface {
	// Run commits sealed system setup and starts the app process.
	Run(rs *RunState) error
}

Directories

Path Synopsis
Package instance exposes cross-package implementation details and provides constructors for builtin implementations.
Package instance exposes cross-package implementation details and provides constructors for builtin implementations.
internal

Jump to

Keyboard shortcuts

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