server

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 39 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 server accepts Wayland clients and runs the core protocol objects.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotListening = errors.New("not a listening Unix socket")

Functions

func Event

func Event(out *wire.Conn, r wire.Resource, name string, write func(*wire.Encoder)) error

func KeepFile

func KeepFile(r wire.Resource, request string, offset int64, data []byte) error

func OnDestroy

func OnDestroy(r wire.Resource, f func() error)

func Track

func Track[T comparable](r wire.Resource, list *[]T, x T)

Types

type BindFunc

type BindFunc func(c *Client, id wire.ObjectID, version uint32) error

type Client

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

func (*Client) Add

func (c *Client) Add(r wire.Resource) error

func (*Client) Conn

func (c *Client) Conn() *wire.Conn

func (*Client) Creds

func (c *Client) Creds() peercred.Credentials

func (*Client) Fail

func (c *Client) Fail(err error) error

func (*Client) Get

func (c *Client) Get(id wire.ObjectID) (wire.Resource, bool)

func (*Client) Gone

func (c *Client) Gone() bool

func (*Client) JournalFileBytes

func (c *Client) JournalFileBytes() int

func (*Client) JournalSize

func (c *Client) JournalSize() (records, messages int)

func (*Client) NewID

func (c *Client) NewID() (wire.ObjectID, error)

func (*Client) Objects

func (c *Client) Objects() []wire.Resource

func (*Client) Remove

func (c *Client) Remove(id wire.ObjectID) error

func (*Client) Restoring

func (c *Client) Restoring() bool

func (*Client) SecurityContext

func (c *Client) SecurityContext() (SecurityContext, bool)

func (*Client) String

func (c *Client) String() string

type ClientState

type ClientState struct {
	FD        int
	PID       int32
	LastID    uint32
	TempFirst uint32
	Inert     []InertObject
	Stream    []byte
	StreamFDs []int
	In        []byte
	InFDs     []int
	Out       []byte
	OutFDs    []int
}

type Display

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

func Adopt

func Adopt(l *loop.Loop, opts Options, st *State, t *handover.FDs) (*Display, error)

func New

func New(l *loop.Loop, opts Options) (*Display, error)

func (*Display) AddClient

func (d *Display) AddClient(fd int) (*Client, error)

func (*Display) AddGlobal

func (d *Display) AddGlobal(iface *wire.Interface, version uint32, bind BindFunc) (*Global, error)

func (*Display) AddGlobalFor

func (d *Display) AddGlobalFor(iface *wire.Interface, version uint32, visible func(*Client) bool, bind BindFunc) (*Global, error)

func (*Display) AddSandbox

func (d *Display) AddSandbox(listener Listener, closeFD int, ctx SecurityContext) error

func (*Display) AppendProtocol

func (d *Display) AppendProtocol(b []byte) ([]byte, error)

func (*Display) CheckKeepable

func (d *Display) CheckKeepable(f func(c *Client) string)

func (*Display) Clients

func (d *Display) Clients() []*Client

func (*Display) Close

func (d *Display) Close() error

func (*Display) KeepHandoverJournal

func (d *Display) KeepHandoverJournal()

func (*Display) Name

func (d *Display) Name() string

func (*Display) NextSerial

func (d *Display) NextSerial() uint32

func (*Display) OnClose

func (d *Display) OnClose(f func() error)

func (*Display) OnHandover

func (d *Display) OnHandover(f func(c *Client, s *Stream) error)

func (*Display) OnPrepareHandover

func (d *Display) OnPrepareHandover(f func(c *Client, s *Stream) error)

func (*Display) OnRetire

func (d *Display) OnRetire(f func(c *Client, out *wire.Conn) error)

func (*Display) Park

func (d *Display) Park() error

func (*Display) Path

func (d *Display) Path() string

func (*Display) RecordProtocol

func (d *Display) RecordProtocol(on bool)

func (*Display) RecordingProtocol

func (d *Display) RecordingProtocol() bool

func (*Display) Restore

func (d *Display) Restore(st *State, t *handover.FDs) (func() error, error)

func (*Display) RestoredClients

func (d *Display) RestoredClients() []*Client

func (*Display) Restrict

func (d *Display) Restrict(ifaces ...*wire.Interface)

func (*Display) Resume

func (d *Display) Resume() error

func (*Display) Serial

func (d *Display) Serial() uint32

func (*Display) Snapshot

func (d *Display) Snapshot(t *handover.FDs, skip func(*Client) bool) (*State, map[*Client]int, error)

func (*Display) StaleAck

func (d *Display) StaleAck(serial uint32) bool

func (*Display) Unkeepable

func (d *Display) Unkeepable(skip func(*Client) bool) []Unkeepable

type Global

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

func (*Global) Name

func (g *Global) Name() uint32

func (*Global) Remove

func (g *Global) Remove() error

func (*Global) SetKey

func (g *Global) SetKey(key string)

type GlobalState

type GlobalState struct {
	Name    uint32
	Iface   string
	Key     string
	Version uint32
}

type InertObject

type InertObject struct {
	ID      uint32
	Iface   string
	Version uint32
}

type Listener

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

func ListeningSocket

func ListeningSocket(fd int) (Listener, error)

func (Listener) Close

func (l Listener) Close() error

type Options

type Options struct {
	RuntimeDir string
	Trace      io.Writer
	Report     func(error)
}

type SecurityContext

type SecurityContext struct {
	Engine     string
	AppID      string
	InstanceID string
}

type State

type State struct {
	Name     string
	Path     string
	ListenFD int
	LockFD   int
	Serial   uint32
	Globals  []GlobalState
	Clients  []ClientState
}

type Stream

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

func (*Stream) Emitted

func (s *Stream) Emitted(r wire.Resource)

func (*Stream) Global

func (s *Stream) Global(iface *wire.Interface) (wire.ObjectID, error)

func (*Stream) MarkInert

func (s *Stream) MarkInert(r wire.Resource)

func (*Stream) Request

func (s *Stream) Request(id wire.ObjectID, iface *wire.Interface, name string) (*wire.Encoder, error)

func (*Stream) Temp

func (s *Stream) Temp() wire.ObjectID

type Unkeepable

type Unkeepable struct {
	PID    int32
	Reason string
}

Jump to

Keyboard shortcuts

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