server

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package server is cuxdeck's HTTP surface: the embedded mobile panel, the deck snapshot API, and the allowlisted action endpoint. It binds to 127.0.0.1 only — the outside world reaches it exclusively through the tunnel the tunnel package supervises.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Auth    *auth.Store
	Push    *push.Store
	TG      *telegram.Store
	Usage   *usagelog.Store
	Version string
	// StartAtLogin state + toggle, injected from main (which owns the
	// OS-specific service code). Nil when unavailable.
	StartAtLoginState func() bool
	SetStartAtLogin   func(on bool) error
	// CurrentURL returns the public tunnel URL (or the local one) so the
	// loopback pairing QR points a phone at the right address.
	CurrentURL func() string
	// Name / SetName read and set a custom display name for this
	// machine, overriding the OS hostname in the deck view.
	Name    func() string
	SetName func(string) error
	// Software update, injected from main (which owns the check loop and
	// the restart). LatestVersion is the last release seen by the checker
	// ("" if unknown), UpdateMode is off|notify|auto, and RunUpdate kicks
	// off an in-place upgrade + restart. Nil when updates aren't wired.
	LatestVersion func() string
	UpdateMode    func() string
	SetUpdateMode func(string) error
	RunUpdate     func() error
	// Lang / SetLang read and set the language used for push/Telegram
	// notifications, mirroring the panel's own language choice.
	Lang    func() string
	SetLang func(string) error
}

Server wires the pieces together.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the full route table.

Jump to

Keyboard shortcuts

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