system

package
v0.0.0-...-53ffc18 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// User type is reverted at final launcher exit.
	User = Enablement(ELen)
	// Process type is unconditionally reverted on exit.
	Process = Enablement(ELen + 1)
)
View Source
const ELen = len(enablementString)

Variables

View Source
var (
	ErrDBusConfig = errors.New("dbus config not supplied")
)

Functions

func TypeString

func TypeString(e Enablement) string

Types

type ACL

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

func (*ACL) Is

func (a *ACL) Is(o Op) bool

func (*ACL) Path

func (a *ACL) Path() string

func (*ACL) String

func (a *ACL) String() string

func (*ACL) Type

func (a *ACL) Type() Enablement

type Criteria

type Criteria struct {
	*Enablements
}

type DBus

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

func (*DBus) Is

func (d *DBus) Is(o Op) bool

func (*DBus) Path

func (d *DBus) Path() string

func (*DBus) String

func (d *DBus) String() string

func (*DBus) Type

func (d *DBus) Type() Enablement

type Enablement

type Enablement uint8

Enablement represents an optional system resource

const (
	EWayland Enablement = iota
	EX11
	EDBus
	EPulse
)

func (Enablement) Mask

func (e Enablement) Mask() Enablements

func (Enablement) String

func (e Enablement) String() string

type Enablements

type Enablements uint64

Enablements represents optional system resources to share

func (*Enablements) Has

func (es *Enablements) Has(e Enablement) bool

Has returns whether a feature is enabled

func (*Enablements) Set

func (es *Enablements) Set(e Enablement)

Set enables a feature

type I

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

func New

func New(uid int) *I

func (*I) ChangeHosts

func (sys *I) ChangeHosts(username string)

ChangeHosts appends an X11 ChangeHosts command Op.

func (*I) Commit

func (sys *I) Commit() error

func (*I) CopyFile

func (sys *I) CopyFile(dst, src string)

CopyFile registers an Op that copies path dst from src.

func (*I) CopyFileType

func (sys *I) CopyFileType(et Enablement, dst, src string)

CopyFileType registers a file copying Op labelled with type et.

func (*I) Ensure

func (sys *I) Ensure(name string, perm os.FileMode)

Ensure the existence and mode of a directory.

func (*I) Ephemeral

func (sys *I) Ephemeral(et Enablement, name string, perm os.FileMode)

Ephemeral ensures the temporary existence and mode of a directory through the life of et.

func (sys *I) Link(oldname, newname string)

Link registers an Op that links dst to src.

func (*I) LinkFileType

func (sys *I) LinkFileType(et Enablement, oldname, newname string)

LinkFileType registers a file linking Op labelled with type et.

func (*I) ProxyDBus

func (sys *I) ProxyDBus(session, system *dbus.Config, sessionPath, systemPath string) error

func (*I) Revert

func (sys *I) Revert(ec *Criteria) error

func (*I) UID

func (sys *I) UID() int

func (*I) UpdatePerm

func (sys *I) UpdatePerm(path string, perms ...acl.Perm)

UpdatePerm appends an ephemeral acl update Op.

func (*I) UpdatePermType

func (sys *I) UpdatePermType(et Enablement, path string, perms ...acl.Perm)

UpdatePermType appends an acl update Op.

func (*I) Write

func (sys *I) Write(dst, src string)

Write registers an Op that writes dst with the contents of src.

func (*I) WriteType

func (sys *I) WriteType(et Enablement, dst, src string)

WriteType registers a file writing Op labelled with type et.

type Mkdir

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

func (*Mkdir) Is

func (m *Mkdir) Is(o Op) bool

func (*Mkdir) Path

func (m *Mkdir) Path() string

func (*Mkdir) String

func (m *Mkdir) String() string

func (*Mkdir) Type

func (m *Mkdir) Type() Enablement

type Op

type Op interface {
	// Type returns Op's enablement type.
	Type() Enablement

	Is(o Op) bool
	Path() string
	String() string
	// contains filtered or unexported methods
}

Op is a reversible system operation.

type Tmpfile

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

func (*Tmpfile) Is

func (t *Tmpfile) Is(o Op) bool

func (*Tmpfile) Path

func (t *Tmpfile) Path() string

func (*Tmpfile) String

func (t *Tmpfile) String() string

func (*Tmpfile) Type

func (t *Tmpfile) Type() Enablement

type XHost

type XHost string

func (XHost) Is

func (x XHost) Is(o Op) bool

func (XHost) Path

func (x XHost) Path() string

func (XHost) String

func (x XHost) String() string

func (XHost) Type

func (x XHost) Type() Enablement

Jump to

Keyboard shortcuts

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