app

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 19 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 app starts the whole daemon (engine + HTTP API + web UI). It is shared by the console daemon and the Windows desktop application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStateDir added in v1.0.4

func DefaultStateDir() string

DefaultStateDir returns where Equinox keeps its settings, torrents and downloads by default: the "data" folder next to the executable, so a per-user or portable install carries its data with it. When that folder cannot be created — a machine-wide install to Program Files, where a standard user has no write access there — a per-user folder is used instead, so the app still starts rather than failing with "access is denied".

func ExeDir

func ExeDir() string

ExeDir returns the directory of the running executable.

func SetupLog

func SetupLog(path string, max int64) error

SetupLog sends the standard logger and everything written to os.Stderr into a size-capped log file. A GUI program has no console, so this is where its messages end up. Both go through one writer because Windows will not rename a file that is open twice.

Types

type App

type App struct {
	Manager  *core.Manager
	Settings *config.Store
	// URL opens the web UI with the access key already included.
	URL string
	// Token is the API access key.
	Token string
	// StateDir is where settings, state, torrent copies and downloads live.
	StateDir string
	// contains filtered or unexported fields
}

App is a running daemon.

func Start

func Start(stateDir, listen string) (*App, error)

Start brings everything up. listen is the preferred HTTP address; if it is taken, a free loopback port is used instead. Only loopback addresses are accepted.

func StartWith added in v1.0.24

func StartWith(stateDir, listen string, opts Options) (*App, error)

StartWith is Start with options. In open mode a busy address is an error, not a reason to move to another port: the proxy in front looks for the server at the address it was given.

func (*App) Close

func (a *App) Close()

Close stops the HTTP server and the engine.

type Options added in v1.0.24

type Options struct {
	// Open is for a server behind a proxy that signs users in (Umbrel): it may listen on any address, and it asks
	// for no personal key (see api.Server.SetOpen). Without it only loopback addresses are accepted.
	Open bool
	// AllowedHosts are host names accepted in open mode besides the usual ones.
	AllowedHosts []string
	// Downloads is where a first start saves torrents, instead of the user's Downloads folder.
	Downloads string
	// Completed, if set, is where a first start moves finished torrents (Umbrel: Downloads/Equinox/complete next to
	// .../incomplete, so a media server pointed at the first never sees a half-downloaded file).
	Completed string
	// TorrentPort, if not 0, is the torrent port on every start whatever the settings say, and the page cannot
	// change it: a container publishes just this port, so any other one would get no incoming connections.
	TorrentPort int
	// Places are the folders the server is given, by the names the system around it shows (see api.Server.SetPlaces).
	Places []api.Place
	// Desktop is set by the desktop program whose window is the user's own browser (Linux, see api.Server.SetBrowserApp).
	Desktop api.Desktop
}

Options are the ways a server differs from the desktop application.

Jump to

Keyboard shortcuts

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