layout

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package layout knows what an installed WittyMediaServer looks like, on every system and however it was installed, and what its programs are called.

A package has one folder a person looks in, the root, holding what they open. Everything else that runs lives in bin, out of sight:

<root>/WittyMediaServer(.exe)              the app, with the tray or menu-bar icon
<root>/Uninstall WittyMediaServer.exe      Windows only
<root>/package-info.json                   how this copy was installed
<root>/wms.json, <root>/data               only when someone chose portable mode
<root>/bin/wittymediaserver(.exe)          the server, and the command line
<root>/bin/ffmpeg(.exe), ffprobe(.exe)
<root>/modules                             signed modules for offline use, when it has any

On a Mac the same parts sit where Apple wants them:

WittyMediaServer.app/Contents/MacOS/WittyMediaServer
WittyMediaServer.app/Contents/Resources/package-info.json, modules
WittyMediaServer.app/Contents/Helpers/wittymediaserver, ffmpeg, ffprobe, ...

A program built from source, or a package from before 0.6.0, has no package-info.json: its root and its bin are simply the folder it is in.

Index

Constants

View Source
const (
	// DesktopApp is what a person opens: the tray or menu-bar app.
	DesktopApp = "WittyMediaServer"
	// ServerCommand is the server and its command line.
	ServerCommand = "wittymediaserver"
	// UninstallApp removes everything, asking first (Windows; a Mac has its own app).
	UninstallApp = "Uninstall WittyMediaServer"
	// Marker is the file that says a folder is an installed package.
	Marker = "package-info.json"
)
View Source
const (
	KindSource  = ""            // built from source, or older than 0.6.0
	KindArchive = "archive"     // a .zip or .tar.gz someone unpacked
	KindMSI     = "msi"         // the Windows installer
	KindDeb     = "deb"         // Debian, Ubuntu and relatives
	KindRPM     = "rpm"         // Fedora, RHEL, openSUSE and relatives
	KindPkg     = "pkg"         // the macOS installer
	KindFreeBSD = "freebsd-pkg" // FreeBSD's pkg
	// One file that holds the whole program, read-only: nothing inside can be replaced.
	KindAppImage = "appimage" // an AppImage someone downloaded and runs
	KindFlatpak  = "flatpak"  // a Flatpak bundle
	KindSnap     = "snap"     // a Snap
)

How a copy was installed. The kind decides who may replace its files.

Variables

This section is empty.

Functions

func Exe

func Exe(name string) string

Exe is a program's file name on this system.

func Obsolete

func Obsolete() []string

Obsolete lists what packages up to 0.5.2-alpha kept in the root and a package no longer holds. An update leaves files it doesn't replace, so the new server clears these itself. Only ever exact names in the root of a package.

Types

type Info

type Info struct {
	Product string `json:"product"`
	Kind    string `json:"kind"`
}

Info is the content of the marker file.

type Package

type Package struct {
	Root string // the folder a person looks in, and where portable files go
	Bin  string // the server and its helpers
	Kind string
}

Package is where a copy of the server is.

func Current

func Current() Package

Current is the package the running program belongs to.

func Find

func Find(exe string) Package

Find works out the package that the program at exe belongs to.

func (Package) ClearObsolete

func (p Package) ClearObsolete()

ClearObsolete removes what Obsolete names, once a package's new parts are in place. Files still in use stay until the next start.

func (Package) MarkerPath

func (p Package) MarkerPath() string

MarkerPath is this package's marker file.

func (Package) Modules

func (p Package) Modules() string

Modules is where a starter set of signed modules is, when this package has one.

func (Package) ProgramDirs

func (p Package) ProgramDirs() []string

ProgramDirs are the folders a helper program can be in, best first: its own folder, and for a package updated from an older one, the root.

func (Package) ServerPath

func (p Package) ServerPath() string

ServerPath is the server program of this package.

Jump to

Keyboard shortcuts

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